Hi! i got those 2 routes: map.preferences ''/preferences'', :controller => ''preferences'', :action => ''new'', :requirements => { :method => :get } map.resource :preferences what i want to do is: - if user type address /preferences it goes to new, instead of index. (this point works) - if method is other than a "get" method, it should do the usual REST action (it doesn''t work). someone know how i do it? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It sounds like you are hacking the singleton resource to fit your url to show as /preferences. I have created a patch that might help you in this case. http://dev.rubyonrails.org/ticket/10578 But anyway still, with your hack the easiest thing to do would be to use the resources and redirect to new on the GET index. On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > i got those 2 routes: > map.preferences ''/preferences'', :controller => ''preferences'', :action > => ''new'', :requirements => { :method => :get } > map.resource :preferences > > what i want to do is: > - if user type address /preferences it goes to new, instead of index. > (this point works) > - if method is other than a "get" method, it should do the usual REST > action (it doesn''t work). > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
your patch looks nice. And i have others question about your patch. does it manage internationalization? i mean /productos/1 and /products/1 would be the same page or just spanish is available? On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It sounds like you are hacking the singleton resource to fit your url > to show as /preferences. I have created a patch that might help you in > this case. > > http://dev.rubyonrails.org/ticket/10578 > > But anyway still, with your hack the easiest thing to do would be to > use the resources and redirect to new on the GET index. > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > Hi! > > i got those 2 routes: > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > => ''new'', :requirements => { :method => :get } > > map.resource :preferences > > > what i want to do is: > > - if user type address /preferences it goes to new, instead of index. > > (this point works) > > - if method is other than a "get" method, it should do the usual REST > > action (it doesn''t work). > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i just try your patch but doesn''t works for me... i don''t know why. i''ll find the problem. On Dec 21, 2:09 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> your patch looks nice. > > And i have others question about your patch. > does it manage internationalization? > i mean /productos/1 and /products/1 would be the same page or just > spanish is available? > > On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > It sounds like you are hacking the singleton resource to fit your url > > to show as /preferences. I have created a patch that might help you in > > this case. > > >http://dev.rubyonrails.org/ticket/10578 > > > But anyway still, with your hack the easiest thing to do would be to > > use the resources and redirect to new on the GET index. > > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > Hi! > > > i got those 2 routes: > > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > > => ''new'', :requirements => { :method => :get } > > > map.resource :preferences > > > > what i want to do is: > > > - if user type address /preferences it goes to new, instead of index. > > > (this point works) > > > - if method is other than a "get" method, it should do the usual REST > > > action (it doesn''t work). > > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
what error did you get? On Dec 21, 6:41 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i just try your patch but doesn''t works for me... i don''t know why. > i''ll find the problem. > > On Dec 21, 2:09 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > your patch looks nice. > > > And i have others question about your patch. > > does it manage internationalization? > > i mean /productos/1 and /products/1 would be the same page or just > > spanish is available? > > > On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > It sounds like you are hacking the singleton resource to fit your url > > > to show as /preferences. I have created a patch that might help you in > > > this case. > > > >http://dev.rubyonrails.org/ticket/10578 > > > > But anyway still, with your hack the easiest thing to do would be to > > > use the resources and redirect to new on the GET index. > > > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > Hi! > > > > i got those 2 routes: > > > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > > > => ''new'', :requirements => { :method => :get } > > > > map.resource :preferences > > > > > what i want to do is: > > > > - if user type address /preferences it goes to new, instead of index. > > > > (this point works) > > > > - if method is other than a "get" method, it should do the usual REST > > > > action (it doesn''t work). > > > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I am afraid, it cannot handle internationalisation On Dec 21, 6:09 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> your patch looks nice. > > And i have others question about your patch. > does it manage internationalization? > i mean /productos/1 and /products/1 would be the same page or just > spanish is available? > > On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > It sounds like you are hacking the singleton resource to fit your url > > to show as /preferences. I have created a patch that might help you in > > this case. > > >http://dev.rubyonrails.org/ticket/10578 > > > But anyway still, with your hack the easiest thing to do would be to > > use the resources and redirect to new on the GET index. > > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > Hi! > > > i got those 2 routes: > > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > > => ''new'', :requirements => { :method => :get } > > > map.resource :preferences > > > > what i want to do is: > > > - if user type address /preferences it goes to new, instead of index. > > > (this point works) > > > - if method is other than a "get" method, it should do the usual REST > > > action (it doesn''t work). > > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ufff feel stupid, it works perfectly (i made a routing error) On Dec 21, 4:59 pm, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am afraid, it cannot handle internationalisation > > On Dec 21, 6:09 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > your patch looks nice. > > > And i have others question about your patch. > > does it manage internationalization? > > i mean /productos/1 and /products/1 would be the same page or just > > spanish is available? > > > On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > It sounds like you are hacking the singleton resource to fit your url > > > to show as /preferences. I have created a patch that might help you in > > > this case. > > > >http://dev.rubyonrails.org/ticket/10578 > > > > But anyway still, with your hack the easiest thing to do would be to > > > use the resources and redirect to new on the GET index. > > > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > Hi! > > > > i got those 2 routes: > > > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > > > => ''new'', :requirements => { :method => :get } > > > > map.resource :preferences > > > > > what i want to do is: > > > > - if user type address /preferences it goes to new, instead of index. > > > > (this point works) > > > > - if method is other than a "get" method, it should do the usual REST > > > > action (it doesn''t work). > > > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Good to know that. May be you should update the ticket with your experience, so others might benefit. Thanks. On Dec 22, 5:26 am, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ufff feel stupid, it works perfectly (i made a routing error) > > On Dec 21, 4:59 pm, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am afraid, it cannot handle internationalisation > > > On Dec 21, 6:09 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > your patch looks nice. > > > > And i have others question about your patch. > > > does it manage internationalization? > > > i mean /productos/1 and /products/1 would be the same page or just > > > spanish is available? > > > > On Dec 21, 10:50 am, blj <bragha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > It sounds like you are hacking the singleton resource to fit your url > > > > to show as /preferences. I have created a patch that might help you in > > > > this case. > > > > >http://dev.rubyonrails.org/ticket/10578 > > > > > But anyway still, with your hack the easiest thing to do would be to > > > > use the resources and redirect to new on the GET index. > > > > > On Dec 21, 1:45 pm, "Jean-Sébastien" <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > > wrote: > > > > > > Hi! > > > > > i got those 2 routes: > > > > > map.preferences ''/preferences'', :controller => ''preferences'', :action > > > > > => ''new'', :requirements => { :method => :get } > > > > > map.resource :preferences > > > > > > what i want to do is: > > > > > - if user type address /preferences it goes to new, instead of index. > > > > > (this point works) > > > > > - if method is other than a "get" method, it should do the usual REST > > > > > action (it doesn''t work). > > > > > > someone know how i do it?--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---