diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-06 22:44:13 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-06 22:44:13 -0300 |
commit | e1e4b1d1fde315c74ad983719ed03407ca324c4b (patch) | |
tree | 72aebd3213e14dbda792d4e1d9c79abd4fa0ab9d | |
parent | d76ef6fa6cd34f4c7023706e8b8b4eb8a6a03b88 (diff) | |
download | rails-e1e4b1d1fde315c74ad983719ed03407ca324c4b.tar.gz rails-e1e4b1d1fde315c74ad983719ed03407ca324c4b.tar.bz2 rails-e1e4b1d1fde315c74ad983719ed03407ca324c4b.zip |
We don't need to check blank? here.
Also the blank? check introduced a bug.
$ rails generate model Foo blank:boolean
form_for(Foo.new(:blank => true)) => ArgumentError, "First argument in form cannot contain nil or be empty"
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 0bb08cd7ff..d3703c9186 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -423,7 +423,7 @@ module ActionView object = nil else object = record.is_a?(Array) ? record.last : record - raise ArgumentError, "First argument in form cannot contain nil or be empty" if object.blank? + raise ArgumentError, "First argument in form cannot contain nil or be empty" unless object object_name = options[:as] || model_name_from_record_or_class(object).param_key apply_form_for_options!(record, object, options) end |