Permalink
Browse files

Added form_remote_for [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3269 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent cebb8ff commit 6b7e51df511ccda550856435029ac7dc232b9d7a @dhh dhh committed Dec 10, 2005
Showing with 7 additions and 1 deletion.
  1. +7 −1 actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -170,6 +170,13 @@ def form_remote_tag(options = {})
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 @@ def submit_to_remote(name, value, options = {})
#
# 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

0 comments on commit 6b7e51d

Please sign in to comment.