Module: ImagesHelper

Defined in:
app/helpers/images_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_autocomplete_tag(image) ⇒ Object



20
21
22
23
24
25
26
27
# File 'app/helpers/images_helper.rb', line 20

def image_autocomplete_tag(image)
  (:figure) do
    (
      image_tag(image.image_file.url(:thumb)) +
      (:caption, "id:#{image.id}", class: ['feedback', 'feedback-primary', 'feedback-thin']) 
    ).html_safe
  end
end

!! Rails already provides image_tag, i.e. it is not required here.



5
6
7
8
# File 'app/helpers/images_helper.rb', line 5

def image_link(image)
  return nil if image.nil?
  link_to(image_tag(image.image_file.url(:thumb)), image)
end

#images_recent_objects_partialTrue

Returns indicates a custom partial should be used, see list_helper.rb

Returns:

  • (True)

    indicates a custom partial should be used, see list_helper.rb



16
17
18
# File 'app/helpers/images_helper.rb', line 16

def images_recent_objects_partial
  true 
end

#images_search_formObject



10
11
12
# File 'app/helpers/images_helper.rb', line 10

def images_search_form
  render('/images/quick_search_form')
end

#thumb_list_tag(object) ⇒ Object

<div class=“easyzoom easyzoom–overlay”>

<a href="<%= @image.image_file.url(:medium) %>">
  <%= image_tag(@image.image_file.url(:medium), 'class' => 'imageZoom') %>
</a>

</div>



35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/images_helper.rb', line 35

def thumb_list_tag(object)
  if object.depictions.any?
    object.depictions.collect{|a|
      (:div, class: [:easyzoom, 'easyzoom--overlay'])  do
        link_to(image_tag(a.image.image_file.url(:medium)), a.image.image_file.url())
        
      end
    }.join.html_safe
  end
end