class Formtastic::Inputs::SelectOneInput

Public Instance Methods

input_wrapping(&block) click to toggle source

def input_options

super.merge include_blank: false

end

# File lib/formtastic/inputs/select_one_input.rb, line 10
def input_wrapping(&block)
  template.content_tag(options[:filter_form] ? :div : :li,
    [template.capture(&block), error_html, hint_html].join("\n").html_safe,
    wrapper_html_options
  )
end
select_html() click to toggle source
# File lib/formtastic/inputs/select_one_input.rb, line 45
def select_html
  selected = options[:selected] || object.send(input_name)
  opts = input_html_options.merge('data-select': 'src')
  opts['data-include-blank'] = '1' if input_options[:include_blank]
  template.select_tag input_name, template.options_for_select(collection, selected), input_options.merge(opts)
end
to_html() click to toggle source
# File lib/formtastic/inputs/select_one_input.rb, line 17
def to_html
  opts = { class: 'select-one-inputs' }
  input_wrapping do
    label_html <<
    template.content_tag(:div, opts) do
      search_box <<
      select_html <<
      template.content_tag(:span, '', class: 'status')
    end
  end
end