Class: GenericFormFor::Inputs::SelectInput
- Inherits:
-
Object
- Object
- GenericFormFor::Inputs::SelectInput
- Includes:
- Base
- Defined in:
- lib/generic_form_for/inputs/select_input.rb
Instance Attribute Summary
Attributes included from Base
#builder, #column, #method, #object, #object_name, #options, #template
Instance Method Summary collapse
- #collection ⇒ Object
- #input_html(config_options = {}) ⇒ Object
- #input_html_options ⇒ Object
- #input_options ⇒ Object
- #selected ⇒ Object
Methods included from Base
#autofocus?, #default_input_options, #form_builder_options, #initialize, #input_html_class, #merge_html_options, #to_html, #wrap_in
Methods included from Base::ErrorMessage
#error_html, #error_html_options, #errors, #errors?, #render_error?
Methods included from Base::Label
#label_html, #label_html_options, #label_text, #render_label?, #requirement_text, #translated_label
Methods included from Base::Validations
#decimals, #limit, #limits_from_validations, #maximal_number, #minimal_number, #required?, #required_from_validations?
Methods included from Base::Hint
#hint_html, #hint_html_options, #hint_text, #render_hint?
Methods included from GenericFormFor::I18n
#translate, #translate_action, #translate_hint, #translate_label, #translate_legend, #translate_placeholder
Instance Method Details
#collection ⇒ Object
26 27 28 |
# File 'lib/generic_form_for/inputs/select_input.rb', line 26 def collection [:collection] end |
#input_html(config_options = {}) ⇒ Object
10 11 12 |
# File 'lib/generic_form_for/inputs/select_input.rb', line 10 def input_html(={}) template.concat builder.select(method, collection, , (,)) end |
#input_html_options ⇒ Object
6 7 8 |
# File 'lib/generic_form_for/inputs/select_input.rb', line 6 def super.except(*[:include_blank, :selected, :value, :prompt]) end |
#input_options ⇒ Object
14 15 16 |
# File 'lib/generic_form_for/inputs/select_input.rb', line 14 def {:selected => selected}.merge(super) end |
#selected ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/generic_form_for/inputs/select_input.rb', line 18 def selected if .key?(:value) return [:value] end return false unless object.respond_to?(method) object.send(method) end |