require 'polygallery' module Polygallery module SimpleFormHelper def self.simple_fields_for_polygallery(fb, title=:gallery, *args, &block) ( '
' << fb.simple_fields_for(title, *args, &block) << '
' ).html_safe end def simple_fields_for_polygallery(fb, title=:gallery, *args, &block) new_block = block_given? ? block : ->(fb2) { render partial: 'polygallery/galleries/simple_fields_for', locals: { f: fb2 } } SimpleFormHelper.simple_fields_for_polygallery( fb, title, *args, &new_block) end end end