<%= simple_form_for user, :method => "post", :remote => true, :url => upload_image_user_path(user), :html => {:multipart => true, :class => 'form-horizontal upload_image' } do |f| %>
<%= image_tag(user.image_url(:big) , alt: current_user.name, class: 'profile_img') %>
<% user.build_profile_image unless user.profile_image %> <%= f.fields_for :profile_image do |p| %>
<%= p.input :image, :label => "Upload Image", :label_html => { class: "upimg, fullcent mb0"}, :value => '', :required => false %> <%= p.input :crop_x, as: :hidden, input_html: { class: :crop_x } %> <%= p.input :crop_y, as: :hidden, input_html: { class: :crop_y } %> <%= p.input :crop_w, as: :hidden, input_html: { class: :crop_w } %> <%= p.input :crop_h, as: :hidden, input_html: { class: :crop_h } %>
<% end %>
<% end %>