I was going through the Rails tutorial from here:
http://ruby.railstutorial.org/chapters/filling-in-the-layout#top
I was getting this exception on my WebRick server:
Started GET "/assets/blueprint/print.css" for 127.0.0.1 at 2011-11-28
14:43:00 +0530
Served asset /blueprint/print.css - 404 Not Found (0ms)
ActionController::RoutingError (No route matches [GET]
"/assets/blueprint/print.css"):
Now i would like to know that when the server is looking under the
assets folder then does it mean that it is the assets folder inside app?
Or do i have to place the assets folder under root application
directory?
The guide says to put it under the /public folder. I am a but confused.
The images, css nothing is being picked up by the browser.
I am on WinXP with Rails 3.1.3.
--
Posted via http://www.ruby-forum.com/.
> Now i would like to know that when the server is looking under the
> assets folder then does it mean that it is the assets folder inside app?
> Or do i have to place the assets folder under root application
> directory?
One way it would be to put the blueprint-stuff under
<rails_root>/public/assets/blueprint/* but this will only work if you
use the static files of blueprint. If you use it with another framework
above it like compass, it seems that you have to wait until that is
ported to the rails asset pipeline.
Also that tutorial is for rails 3.0, which not has the asset-pipeline.
So with all assets related stuff you will stumble upon some problems.
Just start again and use the rails version of that tutorial (3.0.11)
HTH
Norbert
and
custom made stylesheets into public/stylesheets/ and blueprint stuff
into public/stylesheets/blueprint
But it doesn't work for me.
I would give your path a try and let you know. But from what you are
saying that there maybe nothing wrong with what i have done, its just
that some features are yet to added into 3.1.3?
Have a look at the last chapter of the tutorial, it explains how it
works on 3.1. Though as Somnath suggested it may be easier to work
through the tutorial using the earlier rails version, then move to 3.1
Colin
Not finding myself at home with Ruby/Rails at all! :(
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
With the introduction of the asset-pipeline the behaviour of
stylesheet_link_tag changed. This is what makes it incompatible, same is
for the corresponding javascript and image helpers.
In 3.0 and before, the helpers were wired to /public/stylesheets (or
images, javascripts) and you had to place a copy of your css there.
Now with 3.1 and the introduction of the assetpipeline there were changes.
All helpers now create a reference to "/assets/<filename>". You can
either put static assets there, or the recommended way, put your assets
in the corresponding folder under /app/assets/.
The big advantage of this way is, that you can have stylesheets or
javascript in a template or alternative language like less, sass or scss
for styles or coffeescript for javascript.
Theoretically you could even drop your stylesheets in brainfuck[1] if
someone provides a gem that processes the brainfuck document.
The disadvantage on the other hand: People following 3.0 tutorials on a
3.1 environment, asking themself "Why doesnt that work? I using rails
3!" But not realizing the change in the minor version number, since in
many heads a change in minor still means "compatibility"
I hope this short excurse is helping you to get over your problems.
Bye
Norbert
PS: Please use quoting in the future and quote the parts of the message
you are refering to, this would make following the conversation easier.
[1]: http://en.wikipedia.org/wiki/Brainfuck