The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Plugins and the Inflector

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jeremy Voorhis

Posts: 212
Nickname: jvoorhis
Registered: Oct, 2005

Jeremy Voorhis is a Rubyist in northeast Ohio.
Plugins and the Inflector Posted: Jun 30, 2006 7:38 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jeremy Voorhis.
Original Post: Plugins and the Inflector
Feed Title: JVoorhis
Feed URL: http://feeds.feedburner.com/jvoorhis
Feed Description: JVoorhis is a Rubyist in northeast Ohio. He rambles about Ruby on Rails, development practices, other frameworks such as Django, and on other days he is just full of snark.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jeremy Voorhis
Latest Posts From JVoorhis

Advertisement

This is just a quick warning to anybody who may be using custom rules with the Rails inflector.

In a personal project I am tooling around with, I define the following custom rule for the inflector:


Inflector.inflections do |inflect|
  inflect.uncountable 'trash'
end

but a named route defined by the simply_restful plugin gets the helper trashes_url. Of course, this makes perfect sense – by the time your app is loading your custom inflections, your plugins are already available to be used. simply_restful had pluralized my uncountable word and defined my named routes before I ever had a chance to object.

The interesting question here is which behavior is correct?

Read: Plugins and the Inflector

Topic: JRuby gets Gems Previous Topic   Next Topic Topic: A bit more on Capistrano, Windows

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use