Displaying 1 result from an estimated 1 matches for "nested_messag".
Did you mean:
nested_messages
2011 Nov 01
2
Railscast 262 different partial in helper
..."Reply", new_message_path(:parent_id => message) %> |
<%= link_to "Destroy", message, :confirm => "Are you sure?",
:method => :delete %>
</div>
</div>
<% end %>
in to a partial _message.html.erb
and call it with
<%= nested_messages @messages.arrange(:order => :created_at) %>
and the following helper method
module MessagesHelper
def nested_messages(messages)
messages.map do |message, sub_messages|
render(message) + content_tag(:div, nested_messages(sub_messages),
:class => "nested_messages")...