-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract out overrideable Catalog#display_home_content? method
It was previously hard-coded into catalog/index.html.erb that if you has_search_parameters?, you display search results, and otherwise you display "home" splash content. But my app never wants to display home splash content. It wants to always display search results (with no search parameters, that would be: all results). Other apps may want to have different criteria for when to display home splash screen results. By making the logic rely on new extracted `display_home_content?` method, we provide an override hook point to easily customize this choice without having to override the template (with it's future compatibility and maintainance issues). The default defintion of display_home_content? is `!has_search_parameters?` for complete backwards compatibility with previous logic.
- Loading branch information
Showing
4 changed files
with
11 additions
and
5 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