Module: Wallaby::ApplicationHelper
- Defined in:
- lib/helpers/wallaby/application_helper.rb
Overview
Application helper
Instance Method Summary collapse
-
#javascript_include_tag(*sources) ⇒ Object
Add turbolinks options when it’s enabled.
-
#stylesheet_link_tag(*sources) ⇒ Object
Add turbolinks options when it’s enabled.
-
#url_for(options = nil) ⇒ Object
Override ‘actionview/lib/action_view/routing_url_for.rb#url_for` to handle the url_for properly for wallaby engine.
Instance Method Details
#javascript_include_tag(*sources) ⇒ Object
Add turbolinks options when it’s enabled
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/helpers/wallaby/application_helper.rb', line 29 def javascript_include_tag(*sources) = if Wallaby.configuration.features.turbolinks_enabled { 'data-turbolinks-track' => true, 'data-turbolinks-eval' => false } else {} end = .merge!(sources..stringify_keys) super(*sources, ) end |
#stylesheet_link_tag(*sources) ⇒ Object
Add turbolinks options when it’s enabled
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/helpers/wallaby/application_helper.rb', line 17 def stylesheet_link_tag(*sources) = if Wallaby.configuration.features.turbolinks_enabled { 'data-turbolinks-track' => true } else {} end = .merge!(sources..stringify_keys) super(*sources, ) end |
#url_for(options = nil) ⇒ Object
Override ‘actionview/lib/action_view/routing_url_for.rb#url_for` to handle the url_for properly for wallaby engine
6 7 8 9 10 11 12 13 14 |
# File 'lib/helpers/wallaby/application_helper.rb', line 6 def url_for( = nil) # possible Hash or Parameters if .respond_to?(:to_h) \ && [:resources].present? && [:action].present? UrlFor.handle wallaby_engine, else super end end |