From ff22f4cddddb6a8b77fb3e14d10e207284e47ce9 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 20 Dec 2019 09:24:55 +0100 Subject: [PATCH] UX: invites#show can't be requested with json and is not configured properly (#8570) Currently at tempting to access an invite via json will result in the following error: ``` HTTP_ACCEPT application/json, text/javascript, */*; q=0.01 GET /invites/xxxxxxx ActionView::MissingTemplate (Missing template invites/show, application/show with {:locale=>[:en_US, :en], :formats=>[:json], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby]}. Searched in: * "/var/www/discourse/app/views" ) ``` --- config/routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index feaf544f18e..4ec1b521630 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -790,7 +790,9 @@ Discourse::Application.routes.draw do get "/posts/:id/raw-email" => "posts#raw_email" get "raw/:topic_id(/:post_number)" => "posts#markdown_num" - resources :invites + resources :invites, except: [:show] + get "/invites/:id" => "invites#show", constraints: { format: :html } + post "invites/upload_csv" => "invites#upload_csv" post "invites/rescind-all" => "invites#rescind_all_invites" post "invites/reinvite" => "invites#resend_invite"