This is my form :
<%= form_for @user, validate: true do |f| %>
<div class="well-lg">
<h4>Personal Details</h4>
<div class="form-group">
<%= f.label :Role %> <br />
<%= f.select :role, options_for_role, {}, prompt: 'Select One',:class=> 'form-control' %>
</div>
<div class="form-group">
<%= f.label :First_Name %><br />
<%= f.text_field :fname, :class=> 'form-control' %>
</div>
<div class="form-group">
<%= f.label :Last_Name %><br />
<%= f.text_field :lname, :class=> 'form-control' %>
</div>
<div class="form-group">
<%= f.label :Email_Address %><br />
<%= f.email_field :email, :class=> 'form-control' %>
</div>
<div class="form-group">
<%= f.label :Upload_Image %><br />
<%= f.file_field :orgimg, :class => 'fileupload' %>
<div id = 'dvPreview>
</div>
</div>
</div>
<% end %>
Everything works fine but I wanted to preview the image which is uploaded in the form so how can I add image_tag with file field or is there any other solution??
Thanks !!!
By using the following code , I was able to preview the image while uploading