Module: Breeze::ImagesHelper

Defined in:
app/helpers/breeze/images_helper.rb

Instance Method Summary collapse

Instance Method Details

#hidden_for_select_imageObject



44
45
46
47
48
49
50
51
52
# File 'app/helpers/breeze/images_helper.rb', line 44

def hidden_for_select_image
  if(section_id)
    hidden_field_tag :section_id , section_id
  elsif(card_id)
    hidden_field_tag :card_id , card_id
  else
    ""
  end
end


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

def new_link_params
  if(params[:section_id])
    return {section_id: params[:section_id]}
  end
  if(params[:card_id])
    return {card_id: params[:card_id]}
  end
  nil
end

#text_for_indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/breeze/images_helper.rb', line 5

def text_for_index
  if(section_id)
    section = Section.find(section_id)
    return "Select image for Section #{section.index} : #{section.header}"
  end
  if(card_id)
    card = Card.find(card_id)
    return "Select image for Card #{card.index} : #{card.header}"
  end
  if(params[:unused].nil?)
    return "All Images"
  end
  if(params[:unused] == "true")
    return "Unused Images"
  end
  return "Used Images"
end

#text_for_newObject



23
24
25
26
27
28
29
30
31
32
33
# File 'app/helpers/breeze/images_helper.rb', line 23

def text_for_new
  if(section_id)
    section = Section.find(section_id)
    "Add image for Section: #{section.header}"
  elsif(card_id)
    card = Card.find(card_id)
    "Select image for Card: #{card.header}"
  else
    "New Image"
  end
end