Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Css styles not rendering in Rails

I am migrating a front-end project to the rails environment and have currently added two routes: /home and /home/new. The /home view has a link which directs it to /home/new. I have noticed, that when I go to the /home/new page manually, my styles are rendering correctly. However, if I use the link on the /home view to go to the /home/new view, my styles are not rendered properly. Can anyone help me with this?

Link to the Github repository: github.com/rimildeyjsr/sms-scheduler

1 Answer

Irving Amador
Irving Amador
7,488 Points

I think its a turbolinks problem, not sure why but it may not be loading your assets files properly. There should be a solution in the turbolinks webpage: https://github.com/turbolinks/turbolinks

Or you could use this, should work for CSS too: https://gistpages.com/posts/turbolinks-javascript-not-loading-in-rails

Or you can disable turbolinks but i do not recomend that.

Hope it helps.