From 20b84578a2db291b68d8aa483174e1ce0f6e3cad Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 23 Dec 2017 00:56:40 -0600 Subject: [PATCH 1/2] Fix "The action 'show' could not be found for FavoritesController" Fixes an exception on "/favorites/1234" requests. --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index b2d602646..c169cb5c8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -124,7 +124,7 @@ Rails.application.routes.draw do end end resource :dtext_preview, :only => [:create] - resources :favorites + resources :favorites, :only => [:index, :create, :destroy] resources :favorite_groups do member do put :add_post From 6243cc8d48482eb22edb9ee7e1eca4cf30900101 Mon Sep 17 00:00:00 2001 From: evazion Date: Sat, 23 Dec 2017 11:31:12 -0600 Subject: [PATCH 2/2] Fix invalid routes for /posts, /explore/posts. Fixes these invalid routes: * GET http://danbooru.donmai.us/posts/new * GET http://danbooru.donmai.us/posts/1234/edit * POST http://danbooru.donmai.us/posts * DELETE http://danbooru.donmai.us/posts * GET http://danbooru.donmai.us/explore/posts --- config/routes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index c169cb5c8..b2b7f6e26 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,7 +45,7 @@ Rails.application.routes.draw do end end namespace :explore do - resources :posts do + resources :posts, :only => [] do collection do get :popular get :viewed @@ -196,7 +196,7 @@ Rails.application.routes.draw do end end resources :post_replacements, :only => [:index, :new, :create, :update] - resources :posts do + resources :posts, :only => [:index, :show, :update] do resources :events, :only => [:index], :controller => "post_events" resources :replacements, :only => [:index, :new, :create], :controller => "post_replacements" resource :artist_commentary, :only => [:index, :show] do