vendredi 19 juin 2015

How come GET doesn't retrieve Rails assets from "/" href path?

When I first load http://localhost:3000/, all my assets are loaded correctly onto the home page:

Started GET "/" for ::1 at 2015-06-19 20:18:44 -0400 Processing by PagesController#home as HTML Rendered pages/home.html.erb within layouts/application (0.9ms) Maker Load (0.2ms) SELECT "makers".* FROM "makers" WHERE "makers"."id" = ? LIMIT 1 [["id", 1]] Completed 200 OK in 37ms (Views: 36.0ms | ActiveRecord: 0.2ms)

Started GET "/assets/jquery.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/application.css?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/jquery_ujs.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/parallax.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/turbolinks.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/events.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/home.css?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/application.js?body=1" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/sky_6_hr.jpg" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/Utah_venture_centered.jpg" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/Looking.jpg" for ::1 at 2015-06-19 20:18:44 -0400

Started GET "/assets/einstein-office.jpg" for ::1 at 2015-06-19 20:18:44 -0400

But when I press my home page navbar button whose href="/" the JPG assets are not loaded and it is white wherever pictures are supposed to be:

Started GET "/" for ::1 at 2015-06-19 20:33:59 -0400 Processing by PagesController#home as HTML Rendered pages/home.html.erb within layouts/application (0.4ms) Maker Load (0.1ms) SELECT "makers".* FROM "makers" WHERE "makers"."id" = ? LIMIT 1 [["id", 1]] Completed 200 OK in 9ms (Views: 8.0ms | ActiveRecord: 0.1ms)

The CSS and JS seems to be loaded, but it doesn't show up in terminal. Also, if it makes a difference, the Maker Load (0.1ms) is purple with http://localhost:3000/ and is blue and bold with href="/".

In order to correctly load the home page, I must refresh the page or go to http://localhost:3000/ myself.

Shouldn't a simple href="/" be the same as going to http://localhost:3000/?

Aucun commentaire:

Enregistrer un commentaire