What is the best way of organizing and implementing page specific CSS and JavaScript in a Ruby on Rails application? -
question 1: i've heard of creating div class' cater areas of html there way out there? here's link found related mean.
http://brandonhilkert.com/blog/page-specific-javascript-in-rails/
question 2: there way in order me organize css , javascripts in asset folder in rails app in specific folders while accessing asset pipeline benefits? eg.
normal way: assets
images(under assets)
stylesheets(under assets) mycss1 css scss mycss2 css scss mycss3 css scss
javascripts(under assets) myjava1 js myjava2 js myjava custom js
the idea: assets
images(under assets)
stylesheets(under assets) myview(this subfolder of stylesheets folder) mycss1 css scss mycss2 css scss homepage(subfolder) mycss3 css scss
javascripts(under assets) myview(subfolder of javascripts) myjava1 js homepage(subfolder) myjava2 js myjava2 custom js
as far understand, want add custom folders under assets directory, put files specific css , js , use them whenever need it.
to achieve should include files somewhere. default, have appplication layout includes application.js , application.css files includes rest of related files. files known manifest files , using sprockets gem handle dependencies, preprocessing, compressing , other stuff (you can read more here). can change assets folder using config.assets.prefix
or add new paths sprockets using config.assets.paths
(this might looking for. further reading here)
Comments
Post a Comment