post versions: fix undo action.
This commit is contained in:
@@ -24,7 +24,7 @@ class PostVersionsController < ApplicationController
|
||||
@post_version = authorize PostVersion.find(params[:id])
|
||||
@post_version.undo!
|
||||
|
||||
respond_with(@post_version)
|
||||
respond_with(@post_version, location: post_versions_path(search: { post_id: @post_version.post_id }))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<% t.column do |post_version| %>
|
||||
<% if policy(post_version).can_undo? %>
|
||||
<% if policy(post_version).undo? %>
|
||||
<%= link_to "Undo", undo_post_version_path(post_version), method: :put, remote: true, class: "post-version-undo-link" %>
|
||||
<% end %>
|
||||
<% if listing_type(:post_id) == :revert && policy(post_version.post).revert? %>
|
||||
|
||||
Reference in New Issue
Block a user