Class: ImagesGallery::Views::Model
- Defined in:
- lib/images_gallery/views/model.rb
Instance Method Summary collapse
-
#initialize(images) ⇒ Model
constructor
A new instance of Model.
- #template ⇒ Object
Methods inherited from Base
#file_identifier, #link_to, #navigation, #render, #thumbnails
Constructor Details
#initialize(images) ⇒ Model
Returns a new instance of Model.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/images_gallery/views/model.rb', line 12 def initialize(images) super() @depth = 1 @make = images.first.make @model = images.first.model @links = [{ name: "Browse all the images", href: link_to(depth, 'index') }] @links << { name: "Browse all the #{make} images", href: link_to(depth, make) } @links += images.iso_values.map{ |iso_value| { name: "ISO #{iso_value}", href: link_to(depth, make, model, iso_value) } } @sample_images = images @title = "Images by (#{make}) #{model}" end |
Instance Method Details
#template ⇒ Object
25 26 27 |
# File 'lib/images_gallery/views/model.rb', line 25 def template File.('../../templates/layout.html.erb', __FILE__) end |