Inspired by the pluralize method in the text_helper, here''s a patch that adds an optional count parameter to Inflector.pluralize. Example from the tests: assert_equal ''foos'', s.pluralize assert_equal ''foos'', s.pluralize(0) assert_equal ''foo'', s.pluralize(1) assert_equal ''foos'', s.pluralize(2) (meh, trac still pukes when I submit a ticket) _______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
Mislav Marohnić
2006-Jul-21 16:37 UTC
Re: [PATCH] add optional count parameter to pluralize
There is already a view helper with that functionality. Is it needed outside of views? On 7/20/06, Caio Chassot <lists@v2studio.com> wrote:> > Inspired by the pluralize method in the text_helper, here''s a patch > that adds an optional count parameter to Inflector.pluralize._______________________________________________ Rails-core mailing list Rails-core@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails-core
On 2006-07-21, at 13:37 , Mislav Marohnić wrote:> There is already a view helper with that functionality. Is it > needed outside of views? >That would be the helper I mentioned in the fragment you quoted. :P I use active_support outside of rails somewhat often, and that''s where I need it.