In Portuguese it is possible to have the word “serie” which is singular
for
“series”. So I tried to generate scaffold for it with the following
command:
$ rails g scaffold Serie name type
Although when I get http://localhost:3000/series/new the following error
happens:
No route matches {:action=>“show”, :controller=>“series”, :format=>nil}
I did some research and I guess it is related to the fact that there is
no
“serie” word in english, only “series” which is both plural and
singular.
But couldn’t find any solution…
For now I noticed that if I generate the scaffold with the following
command it works just fine.
$ rails g scaffold Series name type
But I was wondering if there is a better solution. Maybe something that
internacionalize the routes for resources or anything?
For now I noticed that if I generate the scaffold with the following command
it works just fine.
$ rails g scaffold Series name type
But I was wondering if there is a better solution. Maybe something that
internacionalize the routes for resources or anything?
You can override the default rules for inflection (that is the
singular/plural rules). If you google for rails custom inflection you
will find links on how to do it.