tension 0.9.10 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tension/controller.rb +3 -3
- data/lib/tension/helper.rb +6 -11
- data/lib/tension/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79990890e3efdb3e301b8a25d1aea118d536167
|
4
|
+
data.tar.gz: 41117c436948f6aef93d09652fdb3a1c503dfc08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d42c14d2bc9d8bb9d787b4a05d5fd94bdcfe35e48f25d09a8cf92eadf68427af0b5f38583bb4566064cd2b24fc32917a6e64d284dc49a72bd167aa49dc639c36
|
7
|
+
data.tar.gz: 691cb93f49e58aefe0c54fa892dac95b2ca7d6a2b9c57cd9fd394fd4b7fe2afde6a566480a6b963a84176f88feddd5f163db269d4d57e9f677e3f46c5ab464ed
|
data/lib/tension/controller.rb
CHANGED
@@ -12,21 +12,21 @@ module Tension
|
|
12
12
|
# Returns the Context for the current controller.
|
13
13
|
#
|
14
14
|
def asset_context
|
15
|
-
find_asset_context( request.
|
15
|
+
find_asset_context( request.path_parameters['controller'] )
|
16
16
|
end
|
17
17
|
|
18
18
|
# Returns the Sprockets Asset for the current action's JavaScript
|
19
19
|
# to be written into the template.
|
20
20
|
#
|
21
21
|
def action_javascript
|
22
|
-
asset_context.js( request.
|
22
|
+
asset_context.js( request.path_parameters['action'] )
|
23
23
|
end
|
24
24
|
|
25
25
|
# Returns the Sprockets Asset for the current action's stylesheet
|
26
26
|
# to be written into the template.
|
27
27
|
#
|
28
28
|
def action_stylesheet
|
29
|
-
asset_context.css( request.
|
29
|
+
asset_context.css( request.path_parameters['action'] )
|
30
30
|
end
|
31
31
|
|
32
32
|
# Proxy to Tension::Environment.find.
|
data/lib/tension/helper.rb
CHANGED
@@ -24,19 +24,14 @@ module Tension
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def asset_for(type, *args)
|
27
|
-
|
28
|
-
action = request.symbolized_path_parameters[:action]
|
27
|
+
return nil if asset_context.nil?
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
when
|
34
|
-
|
35
|
-
when "css"
|
36
|
-
:stylesheet_link_tag
|
29
|
+
case type.to_sym
|
30
|
+
when :js
|
31
|
+
javascript_include_tag( action_javascript.logical_path, *args )
|
32
|
+
when :css
|
33
|
+
stylesheet_link_tag( action_stylesheet.logical_path, *args )
|
37
34
|
end
|
38
|
-
|
39
|
-
send( include_method, asset.logical_path, *args )
|
40
35
|
end
|
41
36
|
end
|
42
37
|
|
data/lib/tension/version.rb
CHANGED