Topic: Pluralize and a few others.
Hi, I'd please like to know how I can use the pluralize method in a rails controller class. It seems to only work in rhtml files.
In my view I can use: <%= pluralize(post_comments.length,'comment') %>
How can I use the pluralize method in my controller? Or perhaps, is there code available for the pluralize method I can copy and paste into my controller?
Also, how is the best way to delete an ActiveRecord collection. Say I find all comments which match a certain condition, what is the best way to delete this collection from the database cleanly?
Then last but maybe not least. I want to format dates retrieved from my database (I'm using sqlite). The dates are saved in the format "0000-00-00 00:00:00", How can I format this so that the date could be something like, "1st July 2006, 3:30AM".