Question

I've watched Bates's RailsCast "Update to Rails 3.1". I'm upgrading from 3.0.9. I followed all the instructions, apparently rather poorly. But I did create an app/assets directory and the requisite subdirectories, and put my stuff that formerly lived under "public" in there

Then I changed all my explicit includes to:

<%= stylesheet_link_tag :defaults %>
<%= javascript_include_tag :defaults %>

which yields:

<link href="/assets/defaults.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/defaults.js" type="text/javascript"></script>

so apparently I'm off the mark there. Any help is appreciated.

Was it helpful?

Solution

You should have application instead of :defaults:

<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>

Then make sure your app/assets/stylesheets/application.css and app/assets/javascripts/application.js has the appropriate manifest directives at the top.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top