I'm on Rails 3.2.8 and I want to switch to using the asset pipeline.
I am on my dev machine, and have my assets set up like this:
app/assets/stylesheets/application.css
:
...
*= require_directory ../public/javascripts/jquery/themes/base
*= require_directory ../public/prototype/stylesheets/css
*/
All my stylesheets and js and images are in the public folder which is a catch-all for now. The folder structure:
app/assets
/stylesheets
/application.css
/javascripts
/images
/public
/stylesheets
/javascripts
/prototype
/images
Currently the public/assets/application.css
file is empty. How do I compile this file in the development environment?
When I run Rails.application.config.assets.paths
in rails console, I'm getting app/assets/public
and not the full directory path for the assets.
In the views, I call the asset pipeline stylesheets:
<%= stylesheet_link_tag 'application.css' %>
EDIT 1:
I tried moving all the stylesheets to app/assets/stylesheets/
but it is not compiling the application.css properly in the view. It compiles to this:
<link href="/assets/application.css" media="screen" rel="stylesheet" type="text/css" />
And when I view the link, localhost:3000/assets/application.css it is a blank file.
EDIT 2: I used single quotes instead of double quotes and that fixed the syntax errors. I think I have a handle on it now that I've figured out the pathing. Thanks!