File tree 4 files changed +12
-7
lines changed
ext/action_dispatch/routing
4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 70
70
Then, in the corresponding view, use the asset helpers:
71
71
72
72
``` erb
73
+ <!-- app/views/ember/index.html.erb -->
74
+
73
75
<%= include_ember_script_tags :frontend %>
74
76
<%= include_ember_stylesheet_tags :frontend %>
75
77
```
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module EmberCli
2
2
module Assets
3
3
class DirectoryAssetMap
4
4
def initialize ( directory )
5
- @directory = Pathname ( directory )
5
+ @directory = Pathname . new ( directory )
6
6
end
7
7
8
8
def to_h
@@ -12,6 +12,10 @@ def to_h
12
12
}
13
13
end
14
14
15
+ private
16
+
17
+ attr_reader :directory
18
+
15
19
def files_with_data
16
20
files . reduce ( { } ) do |manifest , file |
17
21
name = File . basename ( file . path )
@@ -22,10 +26,9 @@ def files_with_data
22
26
end
23
27
end
24
28
25
- private
26
29
27
30
def files
28
- @ directory. children . map { |path | File . new ( path ) }
31
+ directory . children . map { |path | File . new ( path ) }
29
32
end
30
33
end
31
34
end
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ module ActionDispatch
2
2
module Routing
3
3
class Mapper
4
4
def mount_ember_assets ( app_name , to : "/" )
5
- dist_directory = EmberCli [ app_name ] . paths . dist
5
+ app = EmberCli [ app_name ]
6
+ rack_app = Rack ::File . new ( app . dist_path . to_s )
6
7
7
- mount Rack :: File . new ( dist_directory . to_s ) => to
8
+ mount rack_app => to
8
9
end
9
10
end
10
11
end
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ module EmberCli
6
6
module Assets
7
7
class Lookup
8
8
def initialize ( app )
9
- @app = app
10
9
@paths = Paths . new ( app )
11
10
end
12
11
@@ -20,7 +19,7 @@ def stylesheet_assets
20
19
21
20
private
22
21
23
- attr_reader :app , : paths
22
+ attr_reader :paths
24
23
25
24
def asset_map
26
25
AssetMap . new (
You can’t perform that action at this time.
0 commit comments