Sha256: d804a4fbaf63741b8c778c7011b6886b9b7c2ae414faf1c2110d42d0b5818355

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

module SofaGalleryHelper
  
  def sofa_gallery_form_for(record_or_name_or_array, *args, &proc)
    options = args.extract_options!
    form_for(
      record_or_name_or_array,
      *(args << options.merge(:builder => SofaGallery.config.form_builder.to_s.constantize)),
      &proc
    )
  end
  
  def render_gallery(slug, type = 'thumbnails')
    @gallery = SofaGallery::Gallery.find_by_slug(slug)
    if (@gallery)
      render :partial => "sofa_gallery/#{type}"
    else
      render :text => 'Gallery not found.', :status => 404
    end
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sofa_gallery-0.0.5 app/helpers/sofa_gallery_helper.rb
sofa_gallery-0.0.4 app/helpers/sofa_gallery_helper.rb
sofa_gallery-0.0.3 app/helpers/sofa_gallery_helper.rb
sofa_gallery-0.0.2 app/helpers/sofa_gallery_helper.rb
sofa_gallery-0.0.1 app/helpers/sofa_gallery_helper.rb