Module: Polygallery::ViewHelpers

Defined in:
lib/polygallery/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#fields_for_polygallery(title, f, options = {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/polygallery/view_helpers.rb', line 4

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

#simple_fields_for_polygallery(title, f, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/polygallery/view_helpers.rb', line 11

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