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| %>
If you are redirecting anyway, you might as well avoid the remote/AJAX call, and just redirect from the create action.
<%= form_for @my_object do |f| %>
and
def create @my_object = MyObject.new(my_object_params) ... redirect_to some_path end