Just a quick and simple hint!
If you need to set the default formatting of dates throughout your whole application in Ruby on Rails, just add the following line to your "<your application>/config/environment.rb"
my_date_formats = { :default => '%d/%m/%Y' } ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(my_date_formats) ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(my_date_formats)
I was looking for a way to display currency data coming from the database as a long. I found out that Ruby on Rails has a buil-in Module Helper method called ActionView::Helpers::NumberHelper:number_to_currency which allows one to format a number according to some options:
Recent comments
1 day 9 hours ago
1 week 1 day ago
1 week 3 days ago
2 weeks 2 days ago
8 weeks 3 days ago
9 weeks 1 day ago
18 weeks 1 day ago
18 weeks 1 day ago
18 weeks 2 days ago
18 weeks 4 days ago