Hello all,I'm trying to understand how to include a stylesheet that is inside a sub directory in my css assets folder.The folder to include is app/assets/css/fonts - folder of fonts and a stylesheet.css
On Tuesday, April 16, 2013 8:51:37 PM UTC+1, Vell wrote:
>
> In my app/assets/css/application.css.scss I have included the following line:
>
> *= require fonts/stylesheet.css
>
> Then when I precompile I get the following:
>
> Compiled fonts/stylesheet.css (0ms) (pid 30638)
>
This means that the compiled application.css contains the result of compiling fonts/stylesheet.scss
The error you're seeing indicates that you're link directly to fonts/stylesheet.css (ie the produced HTML contains a <link> tag whose href is pointing at that file.
If you want to be able to link to css or javascript like this you need to add the file to the list of items to precompile separately ( there's a setting for this in production.rb). Alternately you could just link to application.css
I had this problem yesterday.
I my /app/views/layouts/application.html.haml I had folowing:
= stylesheet_link_tag "application", :media => "all"
= stylesheet_link_tag "style", :media => "all"
Removing stylesheet_link_tag "style", :media => "all" has solved the problem.
On Wednesday, April 17, 2013 4:58:55 AM UTC-4, Bigos wrote:I had this problem yesterday.
I my /app/views/layouts/application.html.haml I had folowing:
= stylesheet_link_tag "application", :media => "all"
= stylesheet_link_tag "style", :media => "all"
Removing stylesheet_link_tag "style", :media => "all" has solved the problem.I just took a look at my application.html.erb file and saw that I had the following:<%= stylesheet_link_tag "application", media: "all" %><%= stylesheet_link_tag "fonts/stylesheet.css" %><%= javascript_include_tag "application" %>I will remove that second line and see if things compile properly.