Skip to content

Commit

Permalink
Add support for input_options in polaris_collection_check_boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillplatonov committed Dec 30, 2024
1 parent 64fa275 commit 6526a8d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/helpers/polaris/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def polaris_collection_check_boxes(method, collection, value_method, text_method
if value.present?
options[:selected] = value.map { |el| el.public_send(value_method) }
end
input_options = options.delete(:input_options) || {}

render Polaris::ChoiceListComponent.new(
form: self,
Expand All @@ -113,7 +114,11 @@ def polaris_collection_check_boxes(method, collection, value_method, text_method
&block
) do |choice|
collection.each do |item|
choice.with_checkbox(label: item.public_send(text_method), value: item.public_send(value_method))
choice.with_checkbox(
label: item.public_send(text_method),
value: item.public_send(value_method),
input_options: input_options
)
end
end
end
Expand Down

0 comments on commit 6526a8d

Please sign in to comment.