]> source.dussan.org Git - redmine.git/commitdiff
Adds a replacement for deprecated link_to_function helper.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 28 Jul 2012 15:26:45 +0000 (15:26 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 28 Jul 2012 15:26:45 +0000 (15:26 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10092 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index f97cc06386dca9ee09fc7e6fdedae054106c265f..7710f435f5072f665ccb2b603e36d69e5909dd3c 100644 (file)
@@ -983,6 +983,10 @@ module ApplicationHelper
       }.merge(options)
   end
 
+  def link_to_function(name, function, html_options={})
+    content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(html_options))
+  end
+
   def back_url_hidden_field_tag
     back_url = params[:back_url] || request.env['HTTP_REFERER']
     back_url = CGI.unescape(back_url.to_s)