Module: Nacho::Helper
- Includes:
- Common
- Defined in:
- lib/nacho/helper.rb
Constant Summary
Constants included from Common
Common::HTML5_ADD_NEW_VALUE_KEY, Common::HTML5_MODAL_HTML_KEY, Common::HTML5_MODAL_ID_KEY, Common::HTML5_NEW_ITEM_VALUE_KEY, Common::HTML5_OPTION_TEXT_KEY, Common::HTML5_OPTION_VALUE_KEY
Instance Method Summary collapse
-
#nacho_select_tag(name, choices = nil, options = {}, html_options = {}) ⇒ Object
A tag helper version for a FormBuilder class.
Instance Method Details
#nacho_select_tag(name, choices = nil, options = {}, html_options = {}) ⇒ Object
A tag helper version for a FormBuilder class. Will create the select and the needed modal that contains the given form for the target model to create.
A multiple select will generate a button to trigger the modal.
23 24 25 26 27 28 29 |
# File 'lib/nacho/helper.rb', line 23 def nacho_select_tag(name, choices = nil, = {}, = {}) = (name, choices, , ) select_element = select_tag(name, ([:choices]), [:options], [:html_options]) select_element += [:button] if [:html_options][:multiple] select_element end |