Skip to content

Commit

Permalink
🐛 Only render json for manifest requests
Browse files Browse the repository at this point in the history
We were getting the error:

`ActionController::RespondToMismatchError in
Hyrax::ImagesController#manifest`

`respond_to was called multiple times and matched with conflicting
formats in this action. Please note that you may only call respond_to
and match on a single format per action.`

This commit fixes that by only rendering json for manifest requests.
  • Loading branch information
kirkkwang committed Jan 2, 2024
1 parent 66a9405 commit 4723b8f
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ def manifest

json = iiif_manifest_builder.manifest_for(presenter: iiif_manifest_presenter, iiif_manifest_factory: manifest_factory)

respond_to do |wants|
wants.json { render json: json }
wants.html { render json: json }
end
render json: json
end

private
Expand Down

0 comments on commit 4723b8f

Please sign in to comment.