-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warn when using
options_for_select
as a value
- Loading branch information
1 parent
4cd9cb3
commit 3066761
Showing
2 changed files
with
28 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module Phlex::Rails::Helpers::OptionsForSelect | ||
Never = Object.new | ||
|
||
extend Phlex::Rails::HelperMacros | ||
|
||
# @!method options_for_select(...) | ||
# @return [nil] | ||
register_output_helper :options_for_select | ||
def options_for_select(...) | ||
context = @_context | ||
return if context.fragments && !context.in_target_fragment | ||
|
||
raw helpers.options_for_select(...) | ||
|
||
Never | ||
end | ||
end |
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