Ruby on Rails Tuesday, June 20, 2017

> On Jun 20, 2017, at 2:57 PM, fugee ohu <fugee279@gmail.com> wrote:
>
> <%= content_tag_for(:div, post) do %>
> <%= simple_format post.content %>
> <% unless post.attachment.blank? %>
> <%= image_tag(post.attachment, height: 250) %><br>
> <% end %>
> <%= content_tag_for(:div, post, :new_comment) do %>
> <%= link_to 'Comment', new_comment_path( 'comment[commentable_type]': 'Post', 'comment[commentable_id]': post.id), remote: true %>
> <% end %>
> <%= content_tag_for(:div, post, :comments) do %>
> <%= render post.comments %>
> <% end %>
> <% end %>


This part would go into _post.html.erb

Walter

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/16432F1F-E312-44BE-9577-23E9D6A253EB%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment