Integer ordinalization in Ruby/Rails

前端 未结 2 1123
借酒劲吻你
借酒劲吻你 2021-02-20 02:08

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 \

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-20 02:20

    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.

提交回复
热议问题