How to get current_user in model and observer Rails

If you want to log the user who created, updates and delete a object in specific model.There is no default way to fetch the current user in models, current_user is always assigned in controllers (as per authentication plugins, restful_authentication, authlogic and devise). Found one way, by adding some steps in model/user.rb, we can get the […]

How to implement CACHING IN RAILS 3

Why we need to implement? Caching is extremely useful to implement for web applications. When an application is getting a lot of requests and New Relic detects a strain on your instances, it’s probably time to look into caching. Increase performance of the web application. Serving static content to a visitor rather than something generated […]