Fixes overriding of options[:html][:remote] in form_for() (Issue #2094) #2095

merged 2 commits into from Jul 26, 2011

4 participants


In 3.0.9 and below, form_for() could accept a :remote option passed in either options or options[:html]. However, any :remote option passed in as options[:html][:remote] is ignored because of the line:

options[:html][:remote] = options.delete(:remote)

I've changed this to:

options[:html][:remote] = options.delete(:remote) if options.has_key?(:remote)

This resolves issue #2094 and keeps Rails 3.1 consistent with prior versions. Furthermore, this change keeps form_for() consistent with other methods such as link_to() that allow the :remote option to be passed in the same hash as other html options.


Please add a test case.


I merged the changes into a local copy of 3_1_stable and the tests seem to pass. Changes look correct.


@gregmalcolm - Thanks for following up on this!

@tenderlove tenderlove merged commit ef89a70 into rails:master Jul 26, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment