Skip to content

Instantly share code, notes, and snippets.

@rbarazi
Created May 3, 2010 21:13
Show Gist options
  • Save rbarazi/388593 to your computer and use it in GitHub Desktop.
Save rbarazi/388593 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 7-30. Edit Controls for Comment 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 %>
</span>
<% end %>
</h3>
<%= comment.body %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment