Skip to content

Commit

Permalink
Fixes #37623 - Use html format in react controller to allow for ics d…
Browse files Browse the repository at this point in the history
…omains

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.
  • Loading branch information
chris1984 committed Aug 15, 2024
1 parent 6ec00b9 commit addec8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/react_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions test/integration/host_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit addec8c

Please sign in to comment.