Module: TurboRouter::ViewHelpers
- Defined in:
- lib/turbo_router/view_helpers.rb
Instance Method Summary collapse
- #turbo_router_link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
- #turbo_router_load_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
- #turbo_router_render_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
- #turbo_router_route_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
Instance Method Details
#turbo_router_link_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/turbo_router/view_helpers.rb', line 13 def turbo_router_link_to(name = nil, = nil, = nil, &block) = block_given? ? : ||= {} [:data] ||= {} [:data][:turbo_frame] = "_top" block_given? ? link_to(name, , nil, &block) : link_to(name, , , &block) end |
#turbo_router_load_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/turbo_router/view_helpers.rb', line 5 def turbo_router_load_to(name = nil, = nil, = nil, &block) = block_given? ? : ||= {} [:data] ||= {} [:data][:turbo] = false block_given? ? link_to(name, , nil, &block) : link_to(name, , , &block) end |
#turbo_router_render_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/turbo_router/view_helpers.rb', line 21 def turbo_router_render_to(name = nil, = nil, = nil, &block) = block_given? ? : ||= {} [:data] ||= {} [:data][:turbo_frame] ||= :turbo_router_content block_given? ? link_to(name, , nil, &block) : link_to(name, , , &block) end |
#turbo_router_route_to(name = nil, options = nil, html_options = nil, &block) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/turbo_router/view_helpers.rb', line 29 def turbo_router_route_to(name = nil, = nil, = nil, &block) = block_given? ? : ||= {} [:data] ||= {} [:data][:turbo_frame] ||= :turbo_router_content [:data][:turbo_action] = "advance" block_given? ? link_to(name, , nil, &block) : link_to(name, , , &block) end |