2008-06-18

I couldn't find a helper in the API to just display months if you're storing them as numbers (1-12) so I made one.
Add this helper code to your application_helper.rb or other appropriate *_helper.rb file.

	def monthname(monthnumber)
		if monthnumber
			Date::MONTHNAMES[monthnumber]
		end
	end

Use it in your view like this:

< %=h monthname(item.month) %>

Leave a Reply