form_for wrong number of arguments (3 for 2) since upgrade to rails 3.1 form_for wrong number of arguments (3 for 2) since upgrade to rails 3.1 ruby-on-rails ruby-on-rails

form_for wrong number of arguments (3 for 2) since upgrade to rails 3.1


form_for only takes two arguments, the record, and options, although record may be several things, including a simple symbol, an object, or an array.

Try just dropping the first symbol and sending your object. If you model does not include ActiveModel::Naming, you may set the name via the :as option.

<%= form_for @substrate_mass, :as => 'substrate_mass', ... %>

More help may be found here:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for

Or to view the source directly:
https://github.com/rails/rails/blob/v3.1.0/actionpack/lib/action_view/helpers/form_helper.rb#L353