mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
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
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* 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]
|
||||
|
||||
* Modify routing so that you can say :require => { :method => :post } for a route, and the route will never be selected unless the request method is POST. Only works for route recognition, not for route generation. [Jamis Buck]
|
||||
|
||||
* Added :add_headers option to verify which merges a hash of name/value pairs into the response's headers hash if the prerequisites cannot be satisfied. [Sam Stephenson]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user