File tree 1 file changed +16
-14
lines changed
1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change 20
20
say "Remove app/assets/stylesheets/application.css so build output can take over"
21
21
remove_file "app/assets/stylesheets/application.css"
22
22
23
- if ( app_layout_path = Rails . root . join ( "app/views/layouts/application.html.erb" ) ) . exist?
24
- say "Add stylesheet link tag in application layout"
25
- insert_into_file (
26
- app_layout_path . to_s ,
27
- defined? ( Turbo ) ?
28
- %(\n <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>) :
29
- %(\n <%= stylesheet_link_tag "application" %>) ,
30
- before : /\s *<\/ head>/
31
- )
32
- else
33
- say "Default application.html.erb is missing!" , :red
34
- if defined? ( Turbo )
35
- say %( Add <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
23
+ if Rails ::VERSION ::MAJOR < 8
24
+ if ( app_layout_path = Rails . root . join ( "app/views/layouts/application.html.erb" ) ) . exist?
25
+ say "Add stylesheet link tag in application layout"
26
+ insert_into_file (
27
+ app_layout_path . to_s ,
28
+ defined? ( Turbo ) ?
29
+ %(\n <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>) :
30
+ %(\n <%= stylesheet_link_tag "application" %>) ,
31
+ before : /\s *<\/ head>/
32
+ )
36
33
else
37
- say %( Add <%= stylesheet_link_tag "application" %> within the <head> tag in your custom layout.)
34
+ say "Default application.html.erb is missing!" , :red
35
+ if defined? ( Turbo )
36
+ say %( Add <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
37
+ else
38
+ say %( Add <%= stylesheet_link_tag "application" %> within the <head> tag in your custom layout.)
39
+ end
38
40
end
39
41
end
40
42
You can’t perform that action at this time.
0 commit comments