views:

197

answers:

1

I'm writing a plugin that needs some inflections of it's own. Using rails 2.3 wich has the engines embeeded, where I should place my inflections?

+1  A: 

I'd recommend adding a separate file (inflections.rb) in your plugins lib directory plugin. You should be able to load the inflections.rb file from the plugin by adding the following at the beginning of the plugin Ruby file.

require 'inflections"

Your inflections.rb file should follow the format provided as an example in new Rails projects:

# Sample Inflections    
# ActiveSupport::Inflector.inflections do |inflect|
#   inflect.plural /^(ox)$/i, '\1en'
#   inflect.singular /^(ox)en/i, '\1'
#   inflect.irregular 'person', 'people'
#   inflect.uncountable %w( fish sheep )
# end
Scott