In my rails 6 application, I use active storage to upload files to cloudinary. I have a feature where I will like to preview a form before submitting it. This also requires that I preview an uploaded image that is still a tempfile before submitting it. I am setting up the preview in create.html.erb . This is how I have attempted to preview the image tempfile in create.html.erb but it is not working.
<%= image_tag params[:company][:logo].path %>
This is how my company model looks like
class Company < ApplicationRecord
belongs_to :user
has_one_attached :logo
end
How do I display a temp image in my views ?