-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default preview controller should not crash with `config.action_contr…
…oller.include_all_helpers = false` (#2045) * Default preview controller should not crash with `config.action_controller.include_all_helpers = false` (fixes #1654) * PreviewHelper: Rename private #find_template_data method to something less generic The default Rails configuration loads the PreviewHelper for every controller. We should use specific method names to prevent name clashes with user-provided helpers. * Apply suggestions from code review * add nocov * Update docs/CHANGELOG.md --------- Co-authored-by: Joel Hawksley <[email protected]> Co-authored-by: Joel Hawksley <[email protected]>
- Loading branch information
1 parent
c057d4b
commit eba4c14
Showing
5 changed files
with
20 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ def prism_js_source_url | |
serve_static_preview_assets? ? asset_path("prism.min.js", skip_pipeline: true) : "https://cdn.jsdelivr.net/npm/[email protected]/prism.min.js" | ||
end | ||
|
||
def find_template_data(lookup_context:, template_identifier:) | ||
def find_template_data_for_preview_source(lookup_context:, template_identifier:) | ||
template = lookup_context.find_template(template_identifier) | ||
|
||
if Rails.version.to_f >= 6.1 || template.source.present? | ||
|
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