mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Remove the duplicated remote_function and make the real deal public
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -57,9 +57,18 @@ module ActionView
|
||||
end
|
||||
|
||||
def remote_function(options)
|
||||
callbacks = build_callbacks(options)
|
||||
|
||||
function = options[:update] ?
|
||||
"update_with_response('#{options[:update]}', '#{url_for(options[:url])}'#{', Form.serialize(this)' if options[:form]})" :
|
||||
"xml_request('#{url_for(options[:url])}'#{', Form.serialize(this)' if options[:form]})"
|
||||
"update_with_response('#{options[:update]}', " :
|
||||
"xml_request("
|
||||
|
||||
function << "'#{url_for(options[:url])}'"
|
||||
function << ', Form.serialize(this)' if options[:form]
|
||||
function << ', null' if !options[:form] && callbacks
|
||||
function << ", true" if callbacks || options[:type] != :sync
|
||||
function << ", #{callbacks}" if callbacks
|
||||
function << ')'
|
||||
|
||||
function = "#{options[:before]}; #{function}" if options[:before]
|
||||
function = "#{function}; #{options[:after]}" if options[:after]
|
||||
@@ -267,27 +276,6 @@ module ActionView
|
||||
callbacks << "}" if callbacks
|
||||
callbacks
|
||||
end
|
||||
|
||||
def remote_function(options)
|
||||
callbacks = build_callbacks(options)
|
||||
|
||||
function = options[:update] ?
|
||||
"update_with_response('#{options[:update]}', " :
|
||||
"xml_request("
|
||||
|
||||
function << "'#{url_for(options[:url])}'"
|
||||
function << ', Form.serialize(this)' if options[:form]
|
||||
function << ', null' if !options[:form] && callbacks
|
||||
function << ", true" if callbacks || options[:type] != :sync
|
||||
function << ", #{callbacks}" if callbacks
|
||||
function << ')'
|
||||
|
||||
function = "#{options[:before]}; #{function}" if options[:before]
|
||||
function = "#{function}; #{options[:after]}" if options[:after]
|
||||
function = "if (#{options[:condition]}) { #{function}; }" if options[:condition]
|
||||
|
||||
return function
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user