This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def _requirejs_data(name, &block)
11
11
{ } . tap do |data |
12
12
if name
13
13
name += ".js" unless name =~ /\. js$/
14
- data [ 'main' ] = _javascript_path ( name )
14
+ data [ 'main' ] = _javascript_path ( name ) . sub ( / \. js$/ , '' )
15
15
end
16
16
17
17
data . merge! ( yield controller ) if block_given?
@@ -20,15 +20,6 @@ def _requirejs_data(name, &block)
20
20
end . join ( " " )
21
21
end
22
22
23
- def _data_main ( name )
24
- if name
25
- name += ".js" unless name =~ /\. js$/
26
- %Q{data-main="#{ _javascript_path ( name ) } "}
27
- else
28
- ""
29
- end
30
- end
31
-
32
23
def requirejs_include_tag ( name = nil , &block )
33
24
requirejs = Rails . application . config . requirejs
34
25
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ def wrap(tag)
129
129
130
130
test "requirejs_include_tag_with_param" do
131
131
render :text => wrap ( requirejs_include_tag ( "application" ) )
132
- assert_select "script:last-of-type[src^=/javascripts/require.js][data-main^=/javascripts/application.js ]" , :count => 1
132
+ assert_select "script:last-of-type[src^=/javascripts/require.js][data-main^=/javascripts/application]" , :count => 1
133
133
end
134
134
135
135
test "requirejs_include_tag_with_block" do
@@ -138,7 +138,7 @@ def wrap(tag)
138
138
end
139
139
140
140
render :text => wrap ( requirejs_include_tag ( "application" , &test_block ) )
141
- assert_select "script:last-of-type[src^=/javascripts/require.js][data-main^=/javascripts/application.js ]" , :count => 1
141
+ assert_select "script:last-of-type[src^=/javascripts/require.js][data-main^=/javascripts/application]" , :count => 1
142
142
assert_select "script:last-of-type[src^=/javascripts/require.js][data-class^=TestController]" , :count => 1
143
143
end
144
144
You can’t perform that action at this time.
0 commit comments