trustie2/app/helpers/application_helper.rb memo parent_id

This commit is contained in:
zhanyun 2016-12-14 20:27:38 +08:00
parent 196de2fd5e
commit f76360c150
1 changed files with 3 additions and 3 deletions

View File

@ -118,9 +118,9 @@ module ApplicationHelper
def link_to_message(message, options={}, html_options = nil)
link_to(
truncate(message.title, :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)
board_message_path(message.board_id, message.id, {
:r => (message.id),
:anchor => ("message-#{message.id}")
}.merge(options)),
html_options
)