diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-10 00:41:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-12-10 00:41:32 +0000 |
commit | 6b7e51df511ccda550856435029ac7dc232b9d7a (patch) | |
tree | d16407e8fb3cc8761698745f8d87443bc01464e1 /actionpack | |
parent | cebb8ff04b3eb32dd6dd642566e65d1c3869c2ae (diff) | |
download | rails-6b7e51df511ccda550856435029ac7dc232b9d7a.tar.gz rails-6b7e51df511ccda550856435029ac7dc232b9d7a.tar.bz2 rails-6b7e51df511ccda550856435029ac7dc232b9d7a.zip |
Added form_remote_for [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 94de4613ce..647b05779a 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -170,6 +170,13 @@ module ActionView tag("form", options[:html], true) end + # Works like form_remote_tag, but uses form_for semantics. + def form_remote_for(object_name, object, options = {}, &proc) + concat(form_remote_tag(options), proc.binding) + fields_for(object_name, object, &proc) + concat(end_form_tag, proc.binding) + end + # Returns a button input tag that will submit form using XMLHttpRequest # in the background instead of regular reloading POST arrangement. # <tt>options</tt> argument is the same as in <tt>form_remote_tag</tt>. @@ -235,7 +242,6 @@ module ActionView # # See also JavaScriptGenerator and update_page. def update_element_function(element_id, options = {}, &block) - content = escape_javascript(options[:content] || '') content = escape_javascript(capture(&block)) if block |