From 99a1a408cd591ee8dd64b8ea492107279e939f1e Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 11 Dec 2019 02:14:00 -0600 Subject: [PATCH] /artists/banned, /favorites: fix redirects for non-html requests. ref: https://danbooru.donmai.us/forum_topics/9127?page=287#forum_post_161549 --- app/controllers/artists_controller.rb | 2 +- app/controllers/favorites_controller.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 6a123366b..98f479934 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -15,7 +15,7 @@ class ArtistsController < ApplicationController end def banned - redirect_to artists_path(search: { is_banned: "true", order: "updated_at" }) + redirect_to artists_path(search: { is_banned: "true", order: "updated_at" }, format: request.format.symbol) end def ban diff --git a/app/controllers/favorites_controller.rb b/app/controllers/favorites_controller.rb index ab0f5feef..06f79f6e2 100644 --- a/app/controllers/favorites_controller.rb +++ b/app/controllers/favorites_controller.rb @@ -7,11 +7,11 @@ class FavoritesController < ApplicationController def index if params[:user_id].present? user = User.find(params[:user_id]) - redirect_to posts_path(tags: "ordfav:#{user.name}") + redirect_to posts_path(tags: "ordfav:#{user.name}", format: request.format.symbol) elsif CurrentUser.is_member? - redirect_to posts_path(tags: "ordfav:#{CurrentUser.name}") + redirect_to posts_path(tags: "ordfav:#{CurrentUser.name}", format: request.format.symbol) else - redirect_to posts_path + redirect_to posts_path(format: request.format.symbol) end end