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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rails_admin/config/actions/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Show < RailsAdmin::Config::Actions::Base
register_instance_option :controller do
proc do
respond_to do |format|
format.json { render json: @object }
format.html { render @action.template_name }
format.json { render json: @object }
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/integration/actions/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@
end
end

context 'with default format' do
it 'responds with HTML' do
page.driver.options[:headers] = {'HTTP_ACCEPT' => '*/*'}
visit show_path(model_name: 'team', id: team.id)

response_type = Mime::Type.parse(response_headers['Content-Type']).first
expect(response_type).to be_html
end
end

context 'when compact_show_view is enabled' do
it 'hides nil fields in show view by default' do
visit show_path(model_name: 'team', id: team.id)
Expand Down
Loading