diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-03-26 19:45:56 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-03-26 19:45:56 +0000 |
commit | 4238666627a6b319c19f22ee279d15284ed5f245 (patch) | |
tree | cb040eac61bfa5c921bdd780758cf1e9babbabfe /actionpack/lib/action_view | |
parent | c954a5b9a031abd822770f4a084fb476cc2fef56 (diff) | |
download | rails-4238666627a6b319c19f22ee279d15284ed5f245.tar.gz rails-4238666627a6b319c19f22ee279d15284ed5f245.tar.bz2 rails-4238666627a6b319c19f22ee279d15284ed5f245.zip |
Change #form_for and #fields_for so that the second argument is not required [Dave Thomas]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4047 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 72d4e6b475..8380993af8 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -120,7 +120,7 @@ module ActionView # form_for(name, object, options.merge(:builder => LabellingFormBuiler), &proc) # end # - def form_for(object_name, object, options = {}, &proc) + def form_for(object_name, object = nil, options = {}, &proc) raise ArgumentError, "Missing block" unless block_given? concat(form_tag(options.delete(:url) || {}, options.delete(:html) || {}), proc.binding) fields_for(object_name, object, options, &proc) @@ -141,7 +141,7 @@ module ActionView # # Note: This also works for the methods in FormOptionHelper and DateHelper that are designed to work with an object as base. # Like collection_select and datetime_select. - def fields_for(object_name, object, options = {}, &proc) + def fields_for(object_name, object = nil, options = {}, &proc) raise ArgumentError, "Missing block" unless block_given? yield((options[:builder] || FormBuilder).new(object_name, object, self, options, proc)) end |