Class: ComboboxInput

Inherits:
Formtastic::Inputs::SelectInput
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper
Defined in:
app/inputs/combobox_input.rb

Instance Method Summary collapse

Instance Method Details

#input_html_optionsObject



4
5
6
# File 'app/inputs/combobox_input.rb', line 4

def input_html_options
  super.merge({:class => "#{super[:class]} combobox", :style => "width => 60%"})
end


8
9
10
11
12
13
14
# File 'app/inputs/combobox_input.rb', line 8

def link_fragment
  reference = object.send(reflection.name)
  
  return unless reference

  template.('span', template.link_to('show', @object.send(reflection.name), :class => 'icon-combolink-text'), :class => 'combobox-link')
end

#to_htmlObject



16
17
18
19
20
21
22
# File 'app/inputs/combobox_input.rb', line 16

def to_html
  input_wrapping do
    label_html <<
    (options[:group_by] ? grouped_select_html : select_html) <<
    link_fragment
  end
end