diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-02-23 00:08:15 +0200 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-02-23 01:23:59 +0200 |
commit | 9390bff5ce5fcde82840747fae077ba333375211 (patch) | |
tree | a68e8dd311d80c43640849473539b15764314d84 /railties/lib/rails | |
parent | dcdb8e72cc2c4e57334e0de94f516e53ff028de8 (diff) | |
download | rails-9390bff5ce5fcde82840747fae077ba333375211.tar.gz rails-9390bff5ce5fcde82840747fae077ba333375211.tar.bz2 rails-9390bff5ce5fcde82840747fae077ba333375211.zip |
Improve generated file `app/views/application.html.erb` of plugin
- Do not generate `javascript_include_tag` if `--skip-javascript`
- Generate `<%= csp_meta_tag %>`. Related to #32018.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt b/railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt index 6bc480161d..6e54a1ce9d 100644 --- a/railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt +++ b/railties/lib/rails/generators/rails/plugin/templates/app/views/layouts/%namespaced_name%/application.html.erb.tt @@ -2,9 +2,13 @@ <html> <head> <title><%= humanized %></title> + <%%= csrf_meta_tags %> + <%%= csp_meta_tag %> + <%%= stylesheet_link_tag "<%= namespaced_name %>/application", media: "all" %> + <%- unless options[:skip_javascript] -%> <%%= javascript_include_tag "<%= namespaced_name %>/application" %> - <%%= csrf_meta_tags %> + <%- end -%> </head> <body> |