resources :gives, :singular => :give
Do I need to do something else to let it change the singular form of
“Gives” to be “give”?
Wow, that is really odd. Gife isn’t even a word, as far as I can tell.
You can change this in the inflections.rb file in your
config/initializers folder. It’s pretty well commented and should work
for this case.
I have a model called, “Give”. I understand that it may not be a good
choice for a model, but couldn’t be helped.
You are right that “Give” is a really bad choice for a model name.
Models should be nouns not verbs (i.e. One gives a gift). The model
would be thing given not the act of giving.
That is a really odd inflection bug though. It must be triggering the
wrong inflection rule somehow.
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular ‘give’, ‘gives’
end
in the inflection.rb , then now
gives GET /gives(.:format)
{:action=>“index”, :controller=>“gives”}
POST /gives(.:format)
{:action=>“create”, :controller=>“gives”}
new_give GET /gives/new(.:format)
{:action=>“new”, :controller=>“gives”}
edit_give GET /gives/:id/edit(.:format)
{:action=>“edit”, :controller=>“gives”}
give GET /gives/:id(.:format)
{:action=>“show”, :controller=>“gives”}
That is a really odd inflection bug though. It must be triggering the
wrong inflection rule somehow.
It’s probably got a rule to deal with plurals like knives, lives,
wives, etc. Seeing a table end in “ives” (and not triggering any
higher-priority rule) then makes sense.
Now to go munch on sour cream and chife potato chips, and listen to
some Burl Ife music…