added comment edit

This commit is contained in:
albert
2011-03-08 18:26:10 -05:00
parent 2b2be3263b
commit 4af5c5c38f
3 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
<div id="c-comments">
<div id="a-edit">
<h1>Edit Comment</h1>
<%= simple_form_for(@comment) do |f| %>
<%= f.input :body %>
<%= f.button :submit %>
<% end %>
</div>
</div>

View File

@@ -16,6 +16,7 @@
<li><span class="link">Reply</span></li>
<% if CurrentUser.user.is_janitor? || CurrentUser.user.id == comment.creator_id %>
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete %></li>
<li><%= link_to "Edit", edit_comment_path(comment.id) %></li>
<% end %>
<li><%= link_to "Vote up", comment_votes_path(:comment_id => comment.id, :score => "up"), :method => :post, :remote => true %></li>
<li><%= link_to "Vote down", comment_votes_path(:comment_id => comment.id, :score => "down"), :method => :post, :remote => true %></li>