Hi All, I am having routes like below to delete/list an user. map.connect ''developer/:user_name/delete'',:controller=>"developers",:action=>"delete",:method=>:delete map.connect ''developer/:user_name/list'',:controller=>"developers",:action=>"list",:method=>:get While listing the user by encoding the Dot with %2E, i can see the success response http://localhost:3000/developer/testuser%2Ehu/list<http://localhost:3000/developer/testuser.hu/list> But While trying to delete the user who containing the Dot(.), throws 404 error. http://localhost:3000/developer/testuser%2Ehu/delete<http://localhost:3000/developer/testuser.hu/delete>, thanks in advance regards, Loganathan -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You have the developer/:user_name/delete route set to use "delete" as the method, rather than "get" Since browsers usually don''t support sending requests other than post or get, you''ll need to pass a "_method=delete" parameter to that route Check out the rails guide on routing for more information: http://guides.rubyonrails.org/routing.html#resources-on-the-web -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jAtXSzkQk9sJ. 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 January 2012 13:03, Tim Shaffer <timshaffer-BUHhN+a2lJ4@public.gmane.org> wrote:> You have theĀ developer/:user_name/deleteĀ route set to use "delete" as the > method, rather than "get" > > Since browsers usually don''t support sending requests other than post or > get, you''ll need to pass a "_method=delete" parameter to that route > > Check out the rails guide on routing for more information: > http://guides.rubyonrails.org/routing.html#resources-on-the-webAlso do not pass the user name but the id. 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Tim, I already tried with the get method too. but no luck. regards, Loganathan On Fri, Jan 20, 2012 at 6:33 PM, Tim Shaffer <timshaffer-BUHhN+a2lJ4@public.gmane.org> wrote:> You have the developer/:user_name/delete route set to use "delete" as > the method, rather than "get" > > Since browsers usually don''t support sending requests other than post or > get, you''ll need to pass a "_method=delete" parameter to that route > > Check out the rails guide on routing for more information: > http://guides.rubyonrails.org/routing.html#resources-on-the-web > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/jAtXSzkQk9sJ. > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Colin That was an api call, so we cannot change the url. regards, Loganathan On Fri, Jan 20, 2012 at 6:44 PM, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 20 January 2012 13:03, Tim Shaffer <timshaffer-BUHhN+a2lJ4@public.gmane.org> wrote: > > You have the developer/:user_name/delete route set to use "delete" as > the > > method, rather than "get" > > > > Since browsers usually don''t support sending requests other than post or > > get, you''ll need to pass a "_method=delete" parameter to that route > > > > Check out the rails guide on routing for more information: > > http://guides.rubyonrails.org/routing.html#resources-on-the-web > > Also do not pass the user name but the id. > > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 20, 2012, at 7:38 AM, Loganathan Sellapa wrote:> Hi All, > I am having routes like below to delete/list an user. > > map.connect ''developer/:user_name/delete'',:controller=>"developers",:action=>"delete",:method=>:delete >You probably need to keep the ''.'' from being treated as a separator (like for a format): :requirements => { :user_name => /.*/ } -Rob> map.connect ''developer/:user_name/list'',:controller=>"developers",:action=>"list",:method=>:get > > While listing the user by encoding the Dot with %2E, i can see the success response http://localhost:3000/developer/testuser%2Ehu/list > > But While trying to delete the user who containing the Dot(.), throws 404 error. > > http://localhost:3000/developer/testuser%2Ehu/delete , thanks in advance > > regards, > Loganathan-- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
constraints (:version => /[0-9]{1}(?:.[0-9]{1,2})/) do match ''ws/:api_version => ''api#create'' end This route will match to ''ws/1.23" and you will have params[:version] ="1.23" On Sat, Jan 21, 2012 at 1:35 AM, Rob Biedenharn <rob-GBZH0y1GwQfnZcttdmLDtcI/UQi/AW5J@public.gmane.org>wrote:> > On Jan 20, 2012, at 7:38 AM, Loganathan Sellapa wrote: > > Hi All, > > I am having routes like below to delete/list an user. > > map.connect > ''developer/:user_name/delete'',:controller=>"developers",:action=>"delete",:method=>:delete > > > You probably need to keep the ''.'' from being treated as a separator (like > for a format): > > :requirements => { :user_name => /.*/ } > > -Rob > > map.connect > ''developer/:user_name/list'',:controller=>"developers",:action=>"list",:method=>:get > > While listing the user by encoding the Dot with %2E, i can see the success > response http://localhost:3000/developer/testuser%2Ehu/list<http://localhost:3000/developer/testuser.hu/list> > > But While trying to delete the user who containing the Dot(.), throws 404 > error. > > http://localhost:3000/developer/testuser%2Ehu/delete<http://localhost:3000/developer/testuser.hu/delete>, thanks in advance > regards, > Loganathan > > > -- > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- Regards Mukesh Paras Singh -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I solved the problem by adding *ActionController::Routing::SEPARATORS %w( / ; , ? ) *in my* routes.rb* file, but an warning message is displaying as below config/routes.rb:12: warning: already initialized constant SEPARATORS Want to know whether this warning will be an issue on future? regards, Loganathan On Sat, Jan 21, 2012 at 1:45 AM, Mukesh Singh <mukesh23.singh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> constraints (:version => /[0-9]{1}(?:.[0-9]{1,2})/) do > match ''ws/:api_version => ''api#create'' > end > > This route will match to ''ws/1.23" and you will have params[:version] => "1.23" > > On Sat, Jan 21, 2012 at 1:35 AM, Rob Biedenharn < > rob-GBZH0y1GwQfnZcttdmLDtcI/UQi/AW5J@public.gmane.org> wrote: > >> >> On Jan 20, 2012, at 7:38 AM, Loganathan Sellapa wrote: >> >> Hi All, >> >> I am having routes like below to delete/list an user. >> >> map.connect >> ''developer/:user_name/delete'',:controller=>"developers",:action=>"delete",:method=>:delete >> >> >> You probably need to keep the ''.'' from being treated as a separator (like >> for a format): >> >> :requirements => { :user_name => /.*/ } >> >> -Rob >> >> map.connect >> ''developer/:user_name/list'',:controller=>"developers",:action=>"list",:method=>:get >> >> While listing the user by encoding the Dot with %2E, i can see the >> success response http://localhost:3000/developer/testuser%2Ehu/list<http://localhost:3000/developer/testuser.hu/list> >> >> But While trying to delete the user who containing the Dot(.), throws 404 >> error. >> >> http://localhost:3000/developer/testuser%2Ehu/delete<http://localhost:3000/developer/testuser.hu/delete>, thanks in advance >> regards, >> Loganathan >> >> >> -- >> 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 this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > Regards > Mukesh Paras Singh > > -- > 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 this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.