Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/controllers/inertia_rails/static_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
module InertiaRails
class StaticController < InertiaRails.configuration.parent_controller.constantize
def static
render inertia: params[:component]
respond_to do |format|
format.html { render inertia: params[:component] }
end
end
end
end
6 changes: 6 additions & 0 deletions spec/inertia/rendering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
before { get inertia_route_path }

it { is_expected.to include inertia_div(page) }

context 'with non html format' do
it 'raises UnknownFormat error' do
expect { get '/inertia_route.json' }.to raise_error(ActionController::UnknownFormat)
end
end
end

context 'via a resource inertia route' do
Expand Down