Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TailwinCSS 3 support #1762

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(lib/simple_form/tags.rb) add data attribute option for item wrapper
  • Loading branch information
loqimean authored Jun 15, 2022
commit 0641503244fbf3da4ee3bd091a03d9ac410af465
3 changes: 2 additions & 1 deletion lib/simple_form/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module CollectionExtensions
def render_collection
item_wrapper_tag = @options.fetch(:item_wrapper_tag, :span)
item_wrapper_class = @options[:item_wrapper_class]
item_wrapper_data = @options[:item_wrapper_data]

@collection.map do |item|
value = value_for_collection(item, @value_method)
Expand All @@ -22,7 +23,7 @@ def render_collection
rendered_item = @template_object.label(@object_name, sanitize_attribute_name(value), rendered_item, label_options)
end

item_wrapper_tag ? @template_object.content_tag(item_wrapper_tag, rendered_item, class: item_wrapper_class) : rendered_item
item_wrapper_tag ? @template_object.content_tag(item_wrapper_tag, rendered_item, class: item_wrapper_class, data: item_wrapper_data) : rendered_item
end.join.html_safe
end

Expand Down