Module: Pigeon::TagHelper

Defined in:
app/helpers/pigeon/tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#pigeon_channel_kinds_for_selectObject



11
12
13
14
15
16
17
18
# File 'app/helpers/pigeon/tag_helper.rb', line 11

def pigeon_channel_kinds_for_select
  grouped_options_for_select({
    "Voice Channel" => 
      pigeon_schema_options(VerboiceChannel.schemas, 'verboice/'),
    "Message Channel" => 
      pigeon_schema_options(NuntiumChannel.schemas, 'nuntium/')
  })
end

#pigeon_nuntium_channel_kinds_for_selectObject



7
8
9
# File 'app/helpers/pigeon/tag_helper.rb', line 7

def pigeon_nuntium_channel_kinds_for_select
  options_for_select(pigeon_schema_options(NuntiumChannel.schemas))
end

#pigeon_schema_options(schemas, value_prefix = '') ⇒ Object



20
21
22
23
24
# File 'app/helpers/pigeon/tag_helper.rb', line 20

def pigeon_schema_options(schemas, value_prefix = '')
  schemas.map do |c|
    [c.humanized_name, "#{value_prefix}#{c.kind}"]
  end.sort_by(&:first)
end

#pigeon_verboice_channel_kinds_for_selectObject



3
4
5
# File 'app/helpers/pigeon/tag_helper.rb', line 3

def pigeon_verboice_channel_kinds_for_select
  options_for_select(pigeon_schema_options(VerboiceChannel.schemas))
end