Module: Hermitage::ViewHelpers
- Defined in:
- lib/hermitage/view_helpers.rb
Instance Method Summary collapse
-
#render_gallery_for(objects, options = {}) ⇒ Object
Renders gallery markup.
Instance Method Details
#render_gallery_for(objects, options = {}) ⇒ Object
Renders gallery markup.
Arguments:
-
objects
Array of objects that should be rendered. -
options
Hash of options. There is list of available options in Defaults module.
Examples:
render_gallery_for @images # @images here is array of Image instances
render_gallery_for album.photos # album.photos is array of Photo instances
it will render the objects contained in array and will use :images (or :photos) as config name. Config names are formed by the class name of the first element in array.
21 22 23 |
# File 'lib/hermitage/view_helpers.rb', line 21 def render_gallery_for(objects, = {}) RailsRenderCore.new(objects, ).render if defined? Rails end |