I am building a job app with rails. In my job 'new' page, I have a preview functionality where a user can click on the 'preview' button to have a look at how the job posting would look like. In creating the job, the user would need to upload a company logo. I would like to find a way of previewing the company logo on my preview page. I am using Carrierwave.
I have checked out solutions like preview image rails but it does not serve the exact purpose i want. It only previews the image in the job 'new page' but i want to display it in my preview page.
In my job 'new', I have
<label class="col-md-1 control-label"></label>
<div class="col-md-9">
<%= f.input :unregistered_company_logo, :label => "Company Logo" %>
<%= f.input :unregistered_company_logo_cache, as: :hidden %>
</div>
<%= f.button :submit , name: "previewButt", value: "Preview", formtarget:"_blank", data: { disable_with: false }%>
In the 'preview' page, I have
<%= image_tag @job.unregistered_company_logo, class: "show-logo" %>
I am really stucked on this and I need help