SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot basicwebus's Avatar
    Join Date
    Jul 2003
    Location
    Missouri
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not finding the stylesheet

    When I checked the development.log for the Shovell application I created using the Rails 2 book (pdf version), I noticed it always shows an error that it cannot find the stylesheet. I saved that in public/stylesheets like the book said to do, but the application cannot seem to find it. How do I fix it so the application finds the stylesheet? It seems as if I need to add that to the routes, but I do not know how to do it.
    Here is the error code it gave:
    Code Ruby:
    ActionController::RoutingError (No route matches "/stylesheets/style.css" with {:method=>:get}):
    After the third time of reading the instructions,
    it finally soaks in to my thick skull.



  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure all of your folders and files are consistently spelled with your code. Lower and uppercase consistency too.

  3. #3
    SitePoint Zealot basicwebus's Avatar
    Join Date
    Jul 2003
    Location
    Missouri
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This only file I can find where the code refers to the style sheet is the application.html.erb file. I have been following along with the book Simply Rails 2 by Patrick Lenz. I figured out the problem thanks to your post.
    The book says to put this code:
    Code Ruby:
    <%= stylesheet_link_tag 'style' %>
    But, when I get to the part where I create the style sheet, it says save the file as:
    styles.css

    This is where the problem came in. I should have either put 'styles' instead of 'style' in the code or saved the styles sheet as style.css instead of styles.css.
    Once I resaved the styles sheet as style.css, it found the style sheet.
    Thanks for helping with this.
    After the third time of reading the instructions,
    it finally soaks in to my thick skull.



  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2009
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem man. Glad I could help


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •