Skip to content
Snippets Groups Projects
Commit cacbe3c3 authored by azul's avatar azul
Browse files

Merge branch '163-routing-error-when-deleting-a-page-from-trash-page-is-not-deleted' into 'master'

Resolve "Routing error when deleting a page from trash - page is NOT deleted"

Closes #163

See merge request riseuplabs/crabgrass!156
parents b4525f74 9711f41d
No related branches found
No related tags found
1 merge request!156Resolve "Routing error when deleting a page from trash - page is NOT deleted"
...@@ -14,6 +14,11 @@ class Page::TrashController < Page::SidebarsController ...@@ -14,6 +14,11 @@ class Page::TrashController < Page::SidebarsController
end end
end end
def destroy
@page.destroy
redirect_to me_home_path
end
protected protected
def track_action def track_action
......
...@@ -134,9 +134,9 @@ module Page::SidebarHelper ...@@ -134,9 +134,9 @@ module Page::SidebarHelper
def destroy_line def destroy_line
if may_admin_page? if may_admin_page?
content_tag :li do content_tag :li do
link_to(:destroy_page_via_shred.t, page_trash_path(@page, type: 'destroy'), link_to(:destroy_page_via_shred.t, page_trash_path(@page),
remote: true, remote: true,
method: 'put', method: 'delete',
icon: 'minus', icon: 'minus',
confirm: :destroy_confirmation.t(thing: :page.t)) confirm: :destroy_confirmation.t(thing: :page.t))
end end
......
...@@ -197,7 +197,7 @@ Crabgrass::Application.routes.draw do ...@@ -197,7 +197,7 @@ Crabgrass::Application.routes.draw do
resource :history, only: [:show], controller: 'history' resource :history, only: [:show], controller: 'history'
resource :attributes, only: [:update] resource :attributes, only: [:update]
resource :title, only: %i[edit update], controller: 'title' resource :title, only: %i[edit update], controller: 'title'
resource :trash, only: %i[edit update], controller: 'trash' resource :trash, only: %i[edit update destroy], controller: 'trash'
end end
resources :posts, only: [] do |_posts| resources :posts, only: [] do |_posts|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment