Module: Tension::Controller
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/tension/controller.rb
Defined Under Namespace
Modules: ClassMethods
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.
26 27 28 |
# File 'lib/tension/controller.rb', line 26 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.
33 34 35 |
# File 'lib/tension/controller.rb', line 33 def action_stylesheet asset_context.css( request.symbolized_path_parameters[:action] ) end |
#asset_context ⇒ Object
Returns the Context for the current controller.
40 41 42 |
# File 'lib/tension/controller.rb', line 40 def asset_context find_asset_context( request.symbolized_path_parameters[:controller] ) end |
#find_asset_context(*args) ⇒ Object
Proxy to Tension::Environment.find.
46 47 48 |
# File 'lib/tension/controller.rb', line 46 def find_asset_context(*args) Tension.environment.find_context(*args) end |