Elia Schito

Rails inflector uncountable troubles? Just remember Why’s Dr. Cham!

In Inflector, pluralize, Programming, Rails, Ruby on Rails, Ruby snippets, Tricks, Tutorials, uncountables, Why's Dr. Cham on July 26, 2007 at 6:00 pm
Inflector.inflections do |inflect|
  #this will do nothing, uncountables have precedence
  inflect.irregular 'equipment', 'equipments'

  def inflect.remove_uncountable(word)
    @uncountables.delete word
  inflect.remove_uncountable 'equipment'

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: