<%= link_to message_summary.sender.display_name , :controller => 'user', :action => message_summary.sender.display_name %> <%= "" if not message_summary.message_read? %> <%= link_to message_summary.title , :controller => 'message', :action => 'read', :message_id => message_summary.id %> <%= "" if not message_summary.message_read? %> <%= message_summary.sent_on %> <% if message_summary.message_read? %> <%= button_to 'Mark as unread', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'unread' %> <% else %> <%= button_to 'Mark as read', :controller => 'message', :action => 'mark', :message_id => message_summary.id, :mark => 'read' %> <% end %> <%= button_to 'Reply', :controller => 'message', :action => 'new', :user_id => message_summary.from_user_id %>