I have a modal containing a form, in which the user can upload a photo. Once the photo is correctly uploaded I want to respond via Ajax and display a message.
Unfortunately the form is subbmitted in HTML and Not in JS.
Any idea?
Form code:
<%= form_for(Object.new() , :url => {:controller => 'objects', :action => 'create'}, :remote=> true, :html => { :multipart => true }) do |f| %>
<%= f.file_field :photo, label: 'add a photo' %>
<%= button_tag(type: 'submit', class: "btn btn-success") do %>
<i class="icon-arrow-up icon-white upload"></i>Upload
<% end %>
<% end %>
Thanks