From 89d8afa2c4f256ffb84b6c9e521546b5dd3e60d8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 31 Dec 2005 03:51:43 +0000 Subject: Added that JavaScriptHelper#link_to_function will honor existing :onclick definitions when adding the function call [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/javascript_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 7dccecda13..3be96db001 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -53,7 +53,7 @@ module ActionView "a", name, html_options.merge({ :href => html_options[:href] || "#", - :onclick => "#{function};#{html_options[:onclick] ? " #{html_options[:onclick]};" : ""} return false;" + :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function}; return false;" }) ) end -- cgit v1.2.3