0

This is a follow-up to this.

What is the proper thing to do when you want Rails and all its helpers to work correctly with words like CarsForRent given that you follow conventions for database and file namings?

inflect.irregular 'car for rent', 'cars for rent' doesn't seem to be enough.

For example, when I generate a model with name CarForRent Rails creates a file named car_for_rents. Is it not smart enough to recognize that CarForRent is like car for rent? Do I have to explicitly define inflect.irregular 'car_for_rent', 'cars_for_rent' or is there a better way?

TylerH
  • 20,799
  • 66
  • 75
  • 101
m33lky
  • 7,055
  • 9
  • 41
  • 48

1 Answers1

0

as i recollect rails takes an uppercase and realises that there should be a break in the word (CamelCase) and replaces it with an underscore, I am not sure if you can override this with configuration, my suggestion would be to use a table called "rental" or something along those lines.

Hope this helps?

Robbie Done
  • 1,157
  • 9
  • 22