Requiring javascript and CSS in Rails without directly injecting code into the HEAD element


/ Published in: Rails
Save to your folder(s)

I used to directly inject javascript and CSS into my HEAD elements just like you see in all of the tutorials online and in books. Recently I decided to try a different approach, and I feel this is more in keeping with the ruby and rails "declaration" syntax. It has the added benefit of promoting unobtrusive javascript coding and factoring out page-specific CSS into its own file.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.