method
convert_options_to_javascript!
convert_options_to_javascript!(html_options)
private
Hide source
# File actionpack/lib/action_view/helpers/url_helper.rb, line 325 def convert_options_to_javascript!(html_options) confirm, popup = html_options.delete("confirm"), html_options.delete("popup") # post is deprecated, but if its specified and method is not, assume that method = :post method, post = html_options.delete("method"), html_options.delete("post") if !method && post ActiveSupport::Deprecation.warn( "Passing :post as a link modifier is deprecated. " + "Use :method => \"post\" instead. :post will be removed in Rails 2.0." ) method = :post end html_options["onclick"] = case when popup && method raise ActionView::ActionViewError, "You can't use :popup and :post in the same link" when confirm && popup "if (#{confirm_javascript_function(confirm)}) { #{popup_javascript_function(popup)} };return false;" when confirm && method "if (#{confirm_javascript_function(confirm)}) { #{method_javascript_function(method)} };return false;" when confirm "return #{confirm_javascript_function(confirm)};" when method "#{method_javascript_function(method)}return false;" when popup popup_javascript_function(popup) + 'return false;' else html_options["onclick"] end end