# 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