jney
December 21, 2007, 9:45am
1
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?
jney
December 21, 2007, 10:51am
2
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” [email protected]
jney
December 21, 2007, 2:10pm
3
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?
jney
December 21, 2007, 2:41pm
4
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” [email protected]
jney
December 21, 2007, 5:00pm
5
what error did you get?
On Dec 21, 6:41 pm, “Jean-Sébastien” [email protected]
jney
December 21, 2007, 5:00pm
6
I am afraid, it cannot handle internationalisation
On Dec 21, 6:09 pm, “Jean-Sébastien” [email protected]
jney
December 22, 2007, 1:26am
7
ufff feel stupid, it works perfectly (i made a routing error)
jney
December 22, 2007, 11:35am
8
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” [email protected]