blog code with rails3