Module: Bizarroids::Slider::ApplicationHelper
- Defined in:
- app/helpers/bizarroids/slider/application_helper.rb
Instance Method Summary collapse
-
#bizarroids_destroy_button(path, confirm_message) ⇒ Object
TODO extract to gem.
-
#bizarroids_edit_button(path) ⇒ Object
TODO extract to gem.
-
#bizarroids_manage_buttons(edit_path, destroy_path, destroy_confirm_message) ⇒ Object
TODO extract to gem.
-
#bizarroids_move_buttons(up_path, down_path) ⇒ Object
TODO extract to gem.
- #bizarroids_slider_each_slide(key) ⇒ Object
- #bizarroids_slider_menu_link ⇒ Object
- #bizarroids_slider_menu_link_active? ⇒ Boolean
- #bizarroids_slider_menu_link_class ⇒ Object
- #bizarroids_slider_slides(key) ⇒ Object
-
#bizarroids_t(key) ⇒ Object
TODO extract to gem.
Instance Method Details
#bizarroids_destroy_button(path, confirm_message) ⇒ Object
TODO extract to gem
14 15 16 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 14 def path, path, :trash, method: :delete, data: { confirm: } end |
#bizarroids_edit_button(path) ⇒ Object
TODO extract to gem
9 10 11 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 9 def path path, :pencil end |
#bizarroids_manage_buttons(edit_path, destroy_path, destroy_confirm_message) ⇒ Object
TODO extract to gem
19 20 21 22 23 24 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 19 def edit_path, destroy_path, safe_join [ (edit_path), (destroy_path, ) ] end |
#bizarroids_move_buttons(up_path, down_path) ⇒ Object
TODO extract to gem
27 28 29 30 31 32 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 27 def up_path, down_path safe_join [ (up_path, :'arrow-up', method: :patch), (down_path, :'arrow-down', method: :patch) ] end |
#bizarroids_slider_each_slide(key) ⇒ Object
52 53 54 55 56 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 52 def key Bizarroids::Slider[key].each do || yield end end |
#bizarroids_slider_menu_link ⇒ Object
34 35 36 37 38 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 34 def link_to bizarroids_t('slider.name'), ., class: [, 'list-group-item'] end |
#bizarroids_slider_menu_link_active? ⇒ Boolean
44 45 46 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 44 def controller.class.parent == Bizarroids::Slider end |
#bizarroids_slider_menu_link_class ⇒ Object
40 41 42 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 40 def ? :active : nil end |
#bizarroids_slider_slides(key) ⇒ Object
48 49 50 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 48 def key Bizarroids::Slider[key] end |
#bizarroids_t(key) ⇒ Object
TODO extract to gem
4 5 6 |
# File 'app/helpers/bizarroids/slider/application_helper.rb', line 4 def bizarroids_t key t key, scope: :bizarroids end |