Module: AgentsHelper

Includes:
PictureFilesHelper
Defined in:
app/helpers/agents_helper.rb

Instance Method Summary collapse

Methods included from PictureFilesHelper

#show_image

Instance Method Details

#agent_custom_book_jacket(agent) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/agents_helper.rb', line 3

def agent_custom_book_jacket(agent)
  link = ''
  agent.picture_files.each_with_index do |picture_file, i|
    if i == 0
      link += link_to(show_image(picture_file, size: :thumb), picture_file_path(picture_file, format: :download), rel: "agent_#{agent.id}")
    else
      link +=  :span, style: "display: none" do
        link_to(show_image(picture_file, size: :thumb), picture_file_path(picture_file, format: :download), rel: "agent_#{agent.id}")
      end
    end
  end
  link.html_safe
end