Sha256: 3df3b4b1ca3e733302ec1b148624f7ff92bb263edb13115785cd6bf0462c23ba

Contents?: true

Size: 758 Bytes

Versions: 13

Compression:

Stored size: 758 Bytes

Contents

module Polygallery
  module ViewHelpers

    def fields_for_polygallery(title, f, options={})
      options = {}.merge(options)
      raise "Polygallery #{title} not found for #{f.object.class.name}" unless f.object.class.has_polygallery?(title)
      gallery = f.object.send(title)
      render :partial => 'polygallery/galleries/fields_for', :locals => {:f => f, :gallery => gallery, :options => options}
    end

    def simple_fields_for_polygallery(title, f, options={})
      options = {
          :label => true,
          :input_html => {}
      }.merge(options)
      gallery = f.object.send(title)
      render :partial => 'polygallery/galleries/simple_fields_for', :locals => {:f => f, :gallery => gallery, :options => options}
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
polygallery-0.3.6 lib/polygallery/view_helpers.rb
polygallery-0.3.5 lib/polygallery/view_helpers.rb
polygallery-0.3.4 lib/polygallery/view_helpers.rb
polygallery-0.3.3 lib/polygallery/view_helpers.rb
polygallery-0.3.2 lib/polygallery/view_helpers.rb
polygallery-0.3.1 lib/polygallery/view_helpers.rb
polygallery-0.3.0 lib/polygallery/view_helpers.rb
polygallery-0.2.5 lib/polygallery/view_helpers.rb
polygallery-0.2.4 lib/polygallery/view_helpers.rb
polygallery-0.2.3 lib/polygallery/view_helpers.rb
polygallery-0.2.1 lib/polygallery/view_helpers.rb
polygallery-0.1.9 lib/polygallery/view_helpers.rb
polygallery-0.1.8 lib/polygallery/view_helpers.rb