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?
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/rG4bH0i0DaAJ.
For more options, visit https://groups.google.com/groups/opt_out.
On 14 August 2012 06:08, Carlos Augusto Borges <calimaborges-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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?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. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Thank you very much. It works =) I used the following inflections.rb (for pt_BR): https://gist.github.com/924574 On Thu, Aug 16, 2012 at 4:50 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 14 August 2012 06:08, Carlos Augusto Borges <calimaborges-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > 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? > > 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. > > Colin > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.