Skip to content

Commit

Permalink
Don't show select prompts for attributes set to false
Browse files Browse the repository at this point in the history
Related issue: rails#51602
  • Loading branch information
mrj committed Apr 19, 2024
1 parent 4d3e291 commit 8625cf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/tags/select_renderer.rb
Expand Up @@ -40,7 +40,7 @@ def add_options(option_tags, options, value = nil)
option_tags = tag_builder.content_tag_string("option", content, value: "", label: label) + "\n" + option_tags
end

if value.blank? && options[:prompt]
if value != false && value.blank? && options[:prompt]
tag_options = { value: "" }.tap do |prompt_opts|
prompt_opts[:disabled] = true if options[:disabled] == ""
prompt_opts[:selected] = true if options[:selected] == ""
Expand Down

0 comments on commit 8625cf3

Please sign in to comment.