Shiva Kumar 's Blog

Start small,Think Big

Loading fonts from assets in rails 3.1

I got lot confused when loading new fonts to my project in rails 3.1 and stackoverflow confused me more ..Actually its very simple .Lets say you have list of fonts First create a fonts directory under assets folder then move all the fonts there.You want to load a font .Insert  @font-face  before the css property […]

, , , ,

Rails Routes Part 1 explained ..

Rails routes ,in simple word it connect incoming request from the browser to controller to perform particular action  .Routes file is in your app/config/routes.rb When a rails application get Url request like this get /user/17 match “users/:id” => “users#show” which means it ask the router to look for users controller and show action where user […]

, ,

Counter_cache => true (improves performance )

Counter cache is a simple feature that keeps the count of child object in parent table .So that you dont have to perform a query to find the size of the object each time  .Rails automatically updates the counter when there is association made between the parent and child .Adding counter_cache to new table is […]


Next posts