Module: Tension::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/tension/controller.rb
Instance Method Summary collapse
-
#action_javascript ⇒ Object
Returns the Sprockets Asset for the current action’s JavaScript to be written into the template.
-
#action_stylesheet ⇒ Object
Returns the Sprockets Asset for the current action’s stylesheet to be written into the template.
-
#asset_context ⇒ Object
Returns the Context for the current controller.
-
#find_asset_context(*args) ⇒ Object
Proxy to Tension::Environment.find.
Instance Method Details
#action_javascript ⇒ Object
Returns the Sprockets Asset for the current action’s JavaScript to be written into the template.
21 22 23 |
# File 'lib/tension/controller.rb', line 21 def action_javascript asset_context.js( request.symbolized_path_parameters[:action] ) end |
#action_stylesheet ⇒ Object
Returns the Sprockets Asset for the current action’s stylesheet to be written into the template.
28 29 30 |
# File 'lib/tension/controller.rb', line 28 def action_stylesheet asset_context.css( request.symbolized_path_parameters[:action] ) end |
#asset_context ⇒ Object
Returns the Context for the current controller.
14 15 16 |
# File 'lib/tension/controller.rb', line 14 def asset_context find_asset_context( request.symbolized_path_parameters[:controller] ) end |
#find_asset_context(*args) ⇒ Object
Proxy to Tension::Environment.find.
34 35 36 |
# File 'lib/tension/controller.rb', line 34 def find_asset_context(*args) Tension.environment.find_context(*args) end |