Class: ImagesGallery::Views::Model

Inherits:
Base
  • Object
show all
Defined in:
lib/images_gallery/views/model.rb

Instance Method Summary collapse

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

#templateObject



25
26
27
# File 'lib/images_gallery/views/model.rb', line 25

def template
  File.expand_path('../../templates/layout.html.erb', __FILE__)
end