Russian Street Bear
Russian Street Bear

Reputation: 61

ruby on rails: public dir, 404

File app/views/layouts/application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <%= csrf_meta_tag %>
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
    <%= stylesheet_link_tag 'blueprint/print',  :media => 'print' %>
    <!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]-->
    <%= stylesheet_link_tag 'custom', :media => 'screen' %>
  </head>
  <body>
    <div class="container">
      <header>
        <%= image_tag("logo.png", :alt => "Sample App", :class => "round") %>
        <nav class="round">
          <ul>
            <li><%= link_to "Home", '#' %></li>
            <li><%= link_to "Help", '#' %></li>
            <li><%= link_to "Sign in", '#' %></li>
          </ul>
        </nav>
      </header>
      <section class="round">
        <%= yield %>
      </section>
    </div>
  </body>
</html>

Now in order.

Function

stylesheet_link_tag 'blueprint/screen', :media => 'screen'

sould return:

<link href="/stylesheets/blueprint/screen.css" media="screen" rel="stylesheet"type="text/css" />

but she return:

<link href="/assets/blueprint/screen.css" media="screen" rel="stylesheet" type="text/css" />

The same problem with:

image_tag("logo.png", :alt => "Sample App", :class => "round")

Server gives 404 error. http://savepic.ru/3169970.jpg

I thought it was a typo in the book. But api.rubyonrails.org says that the book does not make mistakes. http://savepic.ru/3168946.jpg

CSS Framework in public\stylesheets\blueprint

LOGO in public\images\logo.png

How fix this problem? Or maybe it's my inattentiveness?

Upvotes: 0

Views: 248

Answers (1)

jtsagata
jtsagata

Reputation: 2383

That't the expected behaviour. Read about the new asset pipeline here: http://guides.rubyonrails.org/asset_pipeline.html

If you are following a book, use rvm(rvm.io) and setup the exact ruby and rails that the book use

Upvotes: 1

Related Questions