Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Respect :onclick in link_to_toggle_display

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@891 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 48739f3a499452969f3a59ee5ebc4f02e429ea0a 1 parent ebb070e
@dhh dhh authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_view/helpers/javascript_helper.rb
View
3  actionpack/lib/action_view/helpers/javascript_helper.rb
@@ -5,10 +5,11 @@ module Helpers
# You must call <%= define_javascript_functions %> in your application before using these helpers.
module JavascriptHelper
def link_to_toggle_display(name, tags, html_options = {})
+ html_options.symbolize_keys!
toggle_functions = [ tags ].flatten.collect { |tag| "toggle_display_by_id('#{tag}'); " }.join
content_tag(
"a", name,
- html_options.symbolize_keys.merge(:href => "#", :onclick => "#{toggle_functions}; #{html_options['onclick']}; return false;")
+ html_options.merge(:href => "#", :onclick => "#{toggle_functions}#{html_options[:onclick]}; return false;")
)
end
Please sign in to comment.
Something went wrong with that request. Please try again.