Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was playing around with Superglue in a hobby app, which uses the same controller for html views and api calls. So games/show.json would be your json response, and games/show.html would be your html response.
When you install superglue, it assumes that your json response will be the props, so any jbuilder templates will no longer function in favor of the prop templates. This didn't feel right, so I went poking around at adding a new mime type.
This PR allows specifying the format for a request as
:props
rather than:json
. Your file would have to be names[name].props.pbuilder
to be picked up properly.Note that I changed the name of the file to
pbuilder
instead ofprops
. This was just to get it working so I had something to show. The reason it's changed is because the file format is[name].[format].[handler]
. Without changing the name of either the mime type or the handler, the format ends up being[name].props.props
, which looks awful.--
If you want to test this in a superglue app, the following changes need to be made
app/layouts/application.json.props to app/layouts/application.props.pbuilder
formats: [:json]
toformats: [:props]
in your erb views.json.props
files to.props.pbuilder