Theming your rails application
04 Oct 2015I wanted to use bootstrap css in my rails application without using any gems. That mean’t downloading the actuall files and including them in the rails application directory.
step 1: get the files
My prefered way is to place them in the public
folder, this way you won’t have to juggle different directory refrences for the file to be loaded correctly. No need to add any backslashes for the file name and you can import it as you would do any normal html file.
I naviged to the public
folder of the rails app and used bower to fetch the files.
$ bower install bootstrap
step 2: Link your css files
Depending on where you want to access the import the css files, You can add the link to either a particular controller’s view or to the applications layout file to apply the settings globally.
I placed these files into my index.html.erb
file and after that everything was styled according to bootstrap, including the glyphicons.
Want to see something else added? email me