Module: TamSelectHelper
- Defined in:
- lib/generators/tam_select/templates/tam_select_helper.rb
Instance Method Summary collapse
- #tam_select_options(**overrides) ⇒ Object
- #tam_select_tag(name, option_tags = nil, options: {}, html_options: {}, &block) ⇒ Object
Instance Method Details
#tam_select_options(**overrides) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/generators/tam_select/templates/tam_select_helper.rb', line 9 def (**overrides) { searchable: true, clearable: true, creatable: false, placeholder: "Select…" }.merge(overrides) end |
#tam_select_tag(name, option_tags = nil, options: {}, html_options: {}, &block) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/generators/tam_select/templates/tam_select_helper.rb', line 2 def tam_select_tag(name, = nil, options: {}, html_options: {}, &block) data = ([:data] ||= {}) data[:controller] = [data[:controller], "tam-select"].compact.join(" ") data[:tam_select_options_value] = .to_json select_tag(name, , , &block) end |