diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-04-16 19:06:23 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-04-16 19:06:23 +0000 |
commit | ce577e984e88788ad4630c1473fd44b365ac83b6 (patch) | |
tree | f89c10b21e41240da7762c518f584f20523efd90 /actionpack/lib/action_view | |
parent | 7cc446acf49ffdec6d832bc90fe48e1f2f8683cf (diff) | |
download | rails-ce577e984e88788ad4630c1473fd44b365ac83b6.tar.gz rails-ce577e984e88788ad4630c1473fd44b365ac83b6.tar.bz2 rails-ce577e984e88788ad4630c1473fd44b365ac83b6.zip |
Fixed that remote_form_for can leave out the object parameter and default to the instance variable of the object_name, just like form_for [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 1dee0f69f0..1b0a31abb5 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -171,9 +171,10 @@ module ActionView end # Works like form_remote_tag, but uses form_for semantics. - def remote_form_for(object_name, object, options = {}, &proc) + def remote_form_for(object_name, *args, &proc) + options = args.last.is_a?(Hash) ? args.pop : {} concat(form_remote_tag(options), proc.binding) - fields_for(object_name, object, options, &proc) + fields_for(object_name, *(args << options), &proc) concat('</form>', proc.binding) end alias_method :form_remote_for, :remote_form_for |