Module: ActiveAction::ViewHelpers
- Defined in:
- lib/active_action/view_helpers.rb
Constant Summary collapse
- NO_ACTIVE_ACTIONS_MESSAGE =
"<!-- No active actions found. -->"
- DEFAULT_LABEL =
"Active actions"
Instance Method Summary collapse
- #active_actions_button(label) ⇒ Object
- #active_actions_button_for(scopes = [:all], label: DEFAULT_LABEL, renderer: BootstrapDropdown) ⇒ Object
- #active_selection_tag(value, checked = false, options = {}) ⇒ Object
Instance Method Details
#active_actions_button(label) ⇒ Object
10 11 12 |
# File 'lib/active_action/view_helpers.rb', line 10 def (label) (:all, label: label) end |
#active_actions_button_for(scopes = [:all], label: DEFAULT_LABEL, renderer: BootstrapDropdown) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/active_action/view_helpers.rb', line 14 def (scopes = [:all], label: DEFAULT_LABEL, renderer: BootstrapDropdown) actions = active_actions_for(scopes) if actions.empty? return NO_ACTIVE_ACTIONS_MESSAGE.html_safe end renderer.to_html(label: label, actions: actions) end |
#active_selection_tag(value, checked = false, options = {}) ⇒ Object
6 7 8 |
# File 'lib/active_action/view_helpers.rb', line 6 def active_selection_tag(value, checked = false, = {}) check_box_tag 'collection_ids[]', value, checked, {class: 'active_actions_selection'}.merge() end |