-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add blacklight configuration for registering additional response form…
…ats for the #index action Options include: - do the default config.index.respond_to.yaml = true - don't render the format config.index.respond_to.yaml = true - options for render config.index.respond_to.yaml = { layout: 'custom-layout' } - custom proc to render config.index.respond_to.yaml = lambda { render text: "stuff" } - controller method to render config.index.respond_to.yaml = :my_custom_yaml_serialization
- Loading branch information
Showing
4 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this is useful, nice work, thanks.
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there docs anywhere but this commit message? In the docs in this commit message, the examples for 'do the default' and 'don't render the format' are identical.
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrochkind what are you looking at when you say they "are identical"?
I'll be adding docs to the wiki shortly, now that the commits are merged.
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the docs on this commit message:
The first two options given are "do the default", and "don't render the format". The examples of how you do these two things are identical, even though the labels are different, they are both:
config.index.respond_to.yaml = true
. This is probably not right, but I don't know.That is what I mean by "the examples for 'do the default' and 'don't render the format' are identical."
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible the default is "don't render the format", so these are the same? I'm not really sure what the default would be -- I'd think 'the default' is what would happen if you didn't supply any config at all, I'm not sure if that's true in this case, if
true
will always be the same as supplying no config at all.4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, in the commit message. Sorry, I was looking in the tests. default (by which, I meant whatever Rails does) should be true, don't render should be false.
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Normally the default, whatever Rails does, will be raise an exception, I'd imagine.
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or render a template in the appropriate look up path (e.g. index.yaml.erb)
4dd0ff6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right on. And you could actually suppress/override that with
false
, to, I guess, prevent rendering for that format even if Blacklight or another engine provided a proper template. I guess maybe you might want to do that sometimes.