Skip to content

Instantly share code, notes, and snippets.

@ccjr
Created April 3, 2010 19:55
Show Gist options
  • Save ccjr/354807 to your computer and use it in GitHub Desktop.
Save ccjr/354807 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 8-10. The template in app/views/comments/_comment.html.erb
<%= div_for comment do %>
<h3>
<%= comment.name %> &lt;<%= comment.email %>&gt; said:
<% if @article.owned_by? current_user %>
<span class='actions'>
<%= link_to 'Delete', [@article, comment], :confirm => 'Are you sure?', :method => :delete, :remote => true %>
</span>
<% end %>
</h3>
<%= comment.body %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment