The singular and plural forms are the same and I get an undefined_method error when trying to hit the New method.
I realize why and I'm aware that the easiest solution would be to use another name.
I'm also aware that I could create a custom inflection, but what?
The problem is that I REALLY need URLs like /series, /series/1 etc because I'm in fact modelling...wait for it...series of events.
Using "set" or "sequence" or some other synonym doesn't convey the intended meaning.
A series of events is a series not a set or sequence.
Is there a way to "alias" a model?
Should/can I use named routes?
Any help is appreciated.
Assuming you used script/generate scaffold series
to build your model controller et al, you should have a line in /config/routes.rb like
map.resources :series
If you change it to
map.series_index '/series',:controller=>'series',:action=>:index
map.resource :series
It will work. Or you could add Eric Hill's inflection initializer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With