fix for edit forum post links

This commit is contained in:
albert
2013-02-19 12:39:32 -05:00
parent fd14dfb7b5
commit 763b792126
2 changed files with 6 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ class ForumPostsController < ApplicationController
@forum_post = ForumPost.find(params[:id]) @forum_post = ForumPost.find(params[:id])
check_privilege(@forum_post) check_privilege(@forum_post)
@forum_post.update_attributes(params[:forum_post]) @forum_post.update_attributes(params[:forum_post])
respond_with(@forum_post, :location => forum_topic_path(@forum_post.topic, :page => @forum_post.topic.last_page)) respond_with(@forum_post, :location => forum_post_path(@forum_post))
end end
def destroy def destroy

View File

@@ -23,9 +23,12 @@
<% else %> <% else %>
<li><%= link_to "Delete", forum_post_path(forum_post.id), :confirm => "Do you really want to delete this post?", :method => :delete, :remote => true %></li> <li><%= link_to "Delete", forum_post_path(forum_post.id), :confirm => "Do you really want to delete this post?", :method => :delete, :remote => true %></li>
<% end %> <% end %>
<li><%= link_to "Edit", edit_forum_post_path(forum_post.id) %></li>
<li><%= link_to "Permalink", forum_post_path(forum_post) %></li>
<% end %> <% end %>
<% if forum_post.editable_by?(CurrentUser.user) %>
<li><%= link_to "Edit", edit_forum_post_path(forum_post.id) %></li>
<% end %>
<li><%= link_to "Parent", forum_topic_path(forum_post.topic) %></li>
<li><%= link_to "Permalink", forum_post_path(forum_post) %></li>
</menu> </menu>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>