Rails : Best practices to change data in Production database

The situation might come when the whole data-column in few tables of production database have to be altered. Most probably when you forgot to set default value in data-fields and stored Null value is troubling you when querying. Continue reading

Advertisements

Ruby On Rails : Exception Handling Best practices

There are various ways to rescue from exceptions raised in Rails App.

The most basic is

begin
.........
rescue NameOfException => exc
   logger.error("Message for the log file #{exc.message}")
   flash[:notice] = "Store error message"
   redirect_to(:action => 'index')
end

Or you can render a static HTML file namely public/401.html or public/400.html.erb
Continue reading