Module: Breeze::ImagesHelper

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

Instance Method Summary collapse

Instance Method Details

#hidden_for_select_imageObject



38
39
40
41
42
43
44
45
46
# File 'app/helpers/breeze/images_helper.rb', line 38

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


29
30
31
32
33
34
35
36
37
# File 'app/helpers/breeze/images_helper.rb', line 29

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
# File 'app/helpers/breeze/images_helper.rb', line 5

def text_for_index
  if(section_id)
    section = Section.find(section_id)
    "Select image for Section #{section.index} : #{section.header}"
  elsif(card_id)
    card = Card.find(card_id)
    "Select image for Card #{card.index} : #{card.header}"
  else
    "All Images"
  end
end

#text_for_newObject



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

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