Module: ActionView::Helpers::FormHelper
- Includes:
- Nacho::Common
- Defined in:
- lib/nacho/form_builder.rb
Constant Summary
Constants included from Nacho::Common
Nacho::Common::HTML5_ADD_NEW_VALUE_KEY, Nacho::Common::HTML5_MODAL_HTML_KEY, Nacho::Common::HTML5_MODAL_ID_KEY, Nacho::Common::HTML5_NEW_ITEM_VALUE_KEY, Nacho::Common::HTML5_OPTION_TEXT_KEY, Nacho::Common::HTML5_OPTION_VALUE_KEY
Instance Method Summary collapse
-
#nacho_select(object_name, method, choices = nil, options = {}, html_options = {}) ⇒ Object
The helper for a FormBuilder class.
Instance Method Details
#nacho_select(object_name, method, choices = nil, options = {}, html_options = {}) ⇒ Object
The helper 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.
27 28 29 30 31 32 33 |
# File 'lib/nacho/form_builder.rb', line 27 def nacho_select(object_name, method, choices = nil, = {}, = {}) = (method, choices, , ) select_element = select(object_name, method, [:choices], [:options], [:html_options]) select_element += [:button] if [:html_options][:multiple] select_element end |