Hi, I''m trying to make unsubscribe link and currently got a route like this: map.unsubscribe ''/unsubscribe/:email'', :controller => ''foo'', :action => ''bar'' However when I put an email address in the url, it generates "no route" error. It''s probably caused by the dot in email addresses. I''m using Rails 1.2.6. Any ideas how to fix it? 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-/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 -~----------~----~----~----~------~----~------~--~---
Hi, Use a different char for the dot in the request. I''m assuming you''re generating the unsubscribe link. Julian. Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO OUT 3rd APRIL http://sensei.zenunit.com/ On 01/04/2008, at 7:16 PM, szimek wrote:> > Hi, > > I''m trying to make unsubscribe link and currently got a route like > this: > > map.unsubscribe ''/unsubscribe/:email'', :controller => ''foo'', :action > => ''bar'' > > However when I put an email address in the url, it generates "no > route" error. It''s probably caused by the dot in email addresses. > > I''m using Rails 1.2.6. Any ideas how to fix it? > > 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-/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 -~----------~----~----~----~------~----~------~--~---
Julian Leviston wrote:> Hi, > > Use a different char for the dot in the request. I''m assuming you''re > generating the unsubscribe link. > > Julian. > > Learn Ruby on Rails! CHECK OUT THE FREE VIDS (LIMITED TIME) NEW VIDEO > OUT 3rd APRIL > http://sensei.zenunit.com/ > > > On 01/04/2008, at 7:16 PM, szimek wrote: > > > > > Hi, > > > > I''m trying to make unsubscribe link and currently got a route like > > this: > > > > map.unsubscribe ''/unsubscribe/:email'', :controller => ''foo'', :action > > => ''bar'' > > > > However when I put an email address in the url, it generates "no > > route" error. It''s probably caused by the dot in email addresses. > > > > I''m using Rails 1.2.6. Any ideas how to fix it? > > > > Thanks in advance > > >Thanks. Unfortunately I can''t modify the url, at least not the email part - users are redirected to this unsubscribe url from another app that simply adds user''s email at the end of the url. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Szymon Nowak wrote:> map.unsubscribe ''/unsubscribe/:email'', :controller => ''foo'', :action > => ''bar'' > > However when I put an email address in the url, it generates "no > route" error. It''s probably caused by the dot in email addresses.Try: map.unsubscribe ''unsubscribe/*email'', :controller => ''foo'', :action => ''bar'' instead. You''ll have the email address in params[:email][0] as the email part will create an array. -- 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 -~----------~----~----~----~------~----~------~--~---
On Apr 1, 12:32 pm, Mark Bush <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Szymon Nowak wrote: > > map.unsubscribe ''/unsubscribe/:email'', :controller => ''foo'', :action > > => ''bar'' > > > However when I put an email address in the url, it generates "no > > route" error. It''s probably caused by the dot in email addresses. > > Try: > > map.unsubscribe ''unsubscribe/*email'', :controller => ''foo'', :action => > ''bar'' > > instead. You''ll have the email address in params[:email][0] as the > email part will create an array. > > -- > Posted viahttp://www.ruby-forum.com/.Thanks! Works perfectly --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---