Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Consider option[:class] to add class to wrapper div #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
3 changes: 2 additions & 1 deletion lib/nested_form/builder_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def fields_for_with_nested_attributes(association_name, *args)
end

def fields_for_nested_model(name, object, options, block)
classes = 'fields'
classes = 'fields '
classes << ' marked_for_destruction' if object.respond_to?(:marked_for_destruction?) && object.marked_for_destruction?
classes << options.fetch(:class, '')

perform_wrap = options.fetch(:nested_wrapper, true)
perform_wrap &&= options[:wrapper] != false # wrap even if nil
Expand Down