Skip to content

Commit

Permalink
Awful hack for check_box in Rails edge
Browse files Browse the repository at this point in the history
  • Loading branch information
lcreid committed Mar 3, 2024
1 parent 6fb3a20 commit 1df1bbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bootstrap_form/inputs/check_box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def check_box_label(name, options, checked_value, &block)

def check_box_description(name, options, &block)
content = block ? capture(&block) : options[:label]
content || object&.class&.human_attribute_name(name) || name.to_s.humanize
# Ugh. Next Rails after 7.1 passes `false` when there's no object.
content || (object && object&.class&.human_attribute_name(name)) || name.to_s.humanize
end

def check_box_value(name, value)
Expand Down

0 comments on commit 1df1bbe

Please sign in to comment.