We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 09cabb6 + ac054bf commit f76c284Copy full SHA for f76c284
app/controllers/inertia_rails/static_controller.rb
@@ -1,7 +1,9 @@
1
module InertiaRails
2
class StaticController < InertiaRails.configuration.parent_controller.constantize
3
def static
4
- render inertia: params[:component]
+ respond_to do |format|
5
+ format.html { render inertia: params[:component] }
6
+ end
7
end
8
9
spec/inertia/rendering_spec.rb
@@ -62,6 +62,12 @@
62
before { get inertia_route_path }
63
64
it { is_expected.to include inertia_div(page) }
65
+
66
+ context 'with non html format' do
67
+ it 'raises UnknownFormat error' do
68
+ expect { get '/inertia_route.json' }.to raise_error(ActionController::UnknownFormat)
69
70
71
72
73
context 'via a resource inertia route' do
0 commit comments