From: Jean-Philippe Lang Date: Sat, 28 Jul 2012 15:26:45 +0000 (+0000) Subject: Adds a replacement for deprecated link_to_function helper. X-Git-Tag: 2.1.0~231 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6e7507d5800791cbe373465d0949c2a53c8f864d;p=redmine.git Adds a replacement for deprecated link_to_function helper. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10092 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f97cc0638..7710f435f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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)