I’m using Rails 4.2.3. I want to submit a form in a modal dialog, so I have set up my form like so
<%= form_for @my_object, :remote => true do |f| %>
redirect_to events_path, format: 'js'
For this you will need to have events/index.js.erb in your file structure.