Skip to content

Commit 05e02de

Browse files
committed
Make explicit the default media when calling stylesheet_tag and change the default generators.
1 parent cb06727 commit 05e02de

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def stylesheet_path(source)
6868
# Returns a stylesheet link tag for the sources specified as arguments. If
6969
# you don't specify an extension, <tt>.css</tt> will be appended automatically.
7070
# You can modify the link attributes by passing a hash as the last argument.
71+
# For historical reasons, the 'media' attribute will always be present and defaults
72+
# to "screen", so you must explicitely set it to "all" for the stylesheet(s) to
73+
# apply to all media types.
7174
#
7275
# ==== Examples
7376
# stylesheet_link_tag "style" # =>

railties/guides/code/getting_started/app/views/layouts/application.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title>Blog</title>
5-
<%= stylesheet_link_tag "application" %>
5+
<%= stylesheet_link_tag "application", :media => "all" %>
66
<%= javascript_include_tag "application" %>
77
<%= csrf_meta_tags %>
88
</head>

railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title><%= camelized %></title>
5-
<%%= stylesheet_link_tag "application" %>
5+
<%%= stylesheet_link_tag "application", :media => "all" %>
66
<%%= javascript_include_tag "application" %>
77
<%%= csrf_meta_tags %>
88
</head>

railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/%name%/application.html.erb.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<title><%= camelized %></title>
5-
<%%= stylesheet_link_tag "<%= name %>/application" %>
5+
<%%= stylesheet_link_tag "<%= name %>/application", :media => "all" %>
66
<%%= javascript_include_tag "<%= name %>/application" %>
77
<%%= csrf_meta_tags %>
88
</head>

0 commit comments

Comments
 (0)