Module: Interage::CocoonHelper
- Included in:
- ApplicationHelper
- Defined in:
- lib/interage/cocoon_helper.rb
Instance Method Summary collapse
- #cocoon_link_to_add_association(form, association, options = {}) ⇒ Object
- #cocoon_link_to_remove_association(form, label = nil) ⇒ Object
Instance Method Details
#cocoon_link_to_add_association(form, association, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/interage/cocoon_helper.rb', line 5 def cocoon_link_to_add_association(form, association, = {}) label = [:label] || t('buttons.cocoon.add.text') html_class = [:html_class] || bs_default_btn_class('success') link_to_add_association(form, association, class: html_class) do app_icon_text(t('buttons.cocoon.add.icon'), label) end end |
#cocoon_link_to_remove_association(form, label = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/interage/cocoon_helper.rb', line 14 def cocoon_link_to_remove_association(form, label = nil) label ||= t('buttons.cocoon.remove.text') html_class = bs_default_btn_class('danger') content_tag :div, class: 'cocoon-link-to-remove' do link_to_remove_association(form, class: html_class, title: label) do app_icon_text(t('buttons.cocoon.remove.icon'), label) end end end |