Use route helper in #link_to_message.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11186 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-01-14 19:22:09 +00:00
parent b41b738aa4
commit f607a7a023
1 changed files with 3 additions and 5 deletions

View File

@ -120,13 +120,11 @@ module ApplicationHelper
# Generates a link to a message
def link_to_message(message, options={}, html_options = nil)
link_to(
h(truncate(message.subject, :length => 60)),
{ :controller => 'messages', :action => 'show',
:board_id => message.board_id,
:id => (message.parent_id || message.id),
truncate(message.subject, :length => 60),
board_message_path(message.board_id, message.parent_id || message.id, {
:r => (message.parent_id && message.id),
:anchor => (message.parent_id ? "message-#{message.id}" : nil)
}.merge(options),
}.merge(options)),
html_options
)
end