more than 1 route that contains the same number of arguments? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
kreiggers
2007-Feb-23 19:46 UTC
Re: custom routes, you need string literals correct? when using
On Feb 23, 6:14 am, koloa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> more than 1 route that contains the same number of arguments?I think you mean if you have two routes like this: /:arg1/:arg2/:id /:arg3/:arg4/:id then yes Rails needs some why to differentiate these like: /foo/:arg1/:arg2/:id /bar/:arg3/:arg4/:id But don''t forget that you can also differentiate with regex patterns if your args are distinguishable by pattern like /:arg1/:arg2/:id :requirements => { :arg1 => /\d[A-Z]\d/ } /:arg3/:arg4/:id :requirements => { :arg3 => /[a-z]\d[a-z]/ } The first would match something like ''/2D4/anything/12'' and the second would match ''/a5d/anything/12'' and could be routed different ways. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---