diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-12 16:18:29 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-12 16:18:29 +0000 |
commit | 48739f3a499452969f3a59ee5ebc4f02e429ea0a (patch) | |
tree | 3c9f8c60ab22dc08f64e25b313a35a458ccb9a10 /actionpack | |
parent | ebb070e0786994ff96ec08507b169014110740d3 (diff) | |
download | rails-48739f3a499452969f3a59ee5ebc4f02e429ea0a.tar.gz rails-48739f3a499452969f3a59ee5ebc4f02e429ea0a.tar.bz2 rails-48739f3a499452969f3a59ee5ebc4f02e429ea0a.zip |
Respect :onclick in link_to_toggle_display
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@891 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascript_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 7e85519345..d072546a63 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -5,10 +5,11 @@ module ActionView # 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 |