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"