From addec8c7bc4bca65293703fadfac74e33682c36d Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 3 Jul 2024 12:08:02 -0400 Subject: [PATCH] Fixes #37623 - Use html format in react controller to allow for ics domains When having a domain with a .ics extension we get a ActionView::MissingTemplate: Missing template react/index error. This forces the react controller to use the HTML format. With this change the host is able to be loaded in the UI. --- app/controllers/react_controller.rb | 2 +- test/integration/host_test.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/react_controller.rb b/app/controllers/react_controller.rb index 628bc8db9c7..e44983ce223 100644 --- a/app/controllers/react_controller.rb +++ b/app/controllers/react_controller.rb @@ -4,6 +4,6 @@ class ReactController < ApplicationController def index response.headers['X-Request-Path'] = request.path - render 'react/index' + render("react/index", formats: [:html]) end end diff --git a/test/integration/host_test.rb b/test/integration/host_test.rb index 1a6ae0726a3..fad0868a211 100644 --- a/test/integration/host_test.rb +++ b/test/integration/host_test.rb @@ -72,5 +72,11 @@ class HostIntegrationTest < ActionDispatch::IntegrationTest visit clone_host_path(host) assert page.has_no_checked_field?('host_build') end + + test "host with .ics extension" do + domain = FactoryBot.create(:domain, name: 'example.ics') + host = FactoryBot.create(:host, domain: domain) + visit host_details_page_path(host) + end end end