I\'m looking for a way to handle integer ordinalization in Ruby/Rails, ie. \"st\", \"nd\", \"rd\", and \"th\" suffixes to integers. Ruby on Rails used to extend FixNum with an \
The method you want is still ordinalize.
Active_Support was refactored a bit to provide better granularity. Instead of loading in everything at once, you can select smaller chunks depending on what you need.
You can either load everything in Active_Support using require 'active_support/all'
, or break it down using
require 'active_support/core_ext/integer/inflections'
:
>> require 'active_support/core_ext/integer/inflections' #=> true
>> 1.ordinalize #=> "1st"
Lately (last I knew) there has been a trend to not modify core classes. The Rails-Core mailing list might have a better answer for this one.
It looks like that functionality was moved to Inflector from a Fixnum extension which makes sense. Hopefully someone else can confirm this.