lib/polygallery/simple_form_helper.rb in polygallery-0.4.4 vs lib/polygallery/simple_form_helper.rb in polygallery-0.4.5
- old
+ new
@@ -6,12 +6,15 @@
def self.simple_fields_for_polygallery(fb, title=:gallery, *args, &block)
( '<div class="polygallery-fields">' <<
fb.simple_fields_for(title, *args, &block) << '</div>' ).html_safe
end
def simple_fields_for_polygallery(fb, title=:gallery, *args, &block)
+ defaults = { label: nil }
+ settings = if (options = args.find{|a| a.is_a? Hash }).nil? then defaults
+ else defaults.merge options end
new_block = block_given? ? block : ->(fb2) {
render partial: 'polygallery/galleries/simple_fields_for',
- locals: { f: fb2 } }
+ locals: { f: fb2, settings: settings } }
SimpleFormHelper.simple_fields_for_polygallery(
fb, title, *args, &new_block)
end
end