Hi, I am a bit new to the whole RoR thing and have faced small problem, but was not able to fine related answer to my specific condition. I am writing an application called site which I want to be the default root application. I did the required configuration in routes.rb file. Problem is, on the main page, I have a GET form that does not wrap object model, and has an id. I tried manual HTML and it didn''t work when I am visiting the site from http://localhost:3000 because the action ''search'' will point to non-existing action on that level, yielding error: no route found to match "/search" with {:method=>:get} if I go to http://localhost:300/site/index and do the search it works fine. I tried the form_tag and it also didn''t help. Any idea how I can overcome this issue? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bashar Abdullah
2007-Sep-01 18:26 UTC
no route found to match "/search" with {:method=>:get}
Hi, I have posted this before on another site with no help so I''m hoping I will get it here: am a bit new to the whole RoR thing and have faced small problem, but was not able to fine related answer to my specific condition. I am writing an application called site which I want to be the default root application. I did the required configuration in routes.rb file. Problem is, on the main page, I have a GET form that does not wrap object model, and has an id. I tried manual HTML and it didn''t work when I am visiting the site from http://localhost:3000 because the action ''search'' will point to non-existing action on that level, yielding error: no route found to match "/search" with {:method=>:get} if I go to http://localhost:300/site/index and do the search it works fine. I tried the form_tag and it also didn''t help. Any idea how I can overcome this issue? -- 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan
2007-Sep-01 20:04 UTC
Re: no route found to match "/search" with {:method=>:get}
Salam Bashar, I dont exactly understand your problem, but show us some code from your main controller which would be in this case. site / index -- 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 -~----------~----~----~----~------~----~------~--~---
Bashar Abdullah
2007-Sep-02 04:43 UTC
Re: no route found to match "/search" with {:method=>:get}
Salam Jamal, There is nothing much to see in the controller, but rather here is a snippet from the view index generating the GET request: <form id="searchbox_012963" action="search"> <input name="q" type="text" size="40" /> <input type="submit" name="sa" value="Search" /> </form> Now problem is when I visit the index page on http://localhost:3000/site/index the action works just fine. But if I use the root mapping, http://localhost:3000 and then do the search, it will complain that there is no route found for GET on /search. -- 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 -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan
2007-Sep-02 07:16 UTC
Re: no route found to match "/search" with {:method=>:get}
Bashar Abdullah wrote:> Salam Jamal, > > There is nothing much to see in the controller, but rather here is a > snippet from the view index generating the GET request: > > <form id="searchbox_012963" action="search"> > <input name="q" type="text" size="40" /> > <input type="submit" name="sa" value="Search" /> > </form> > > Now problem is when I visit the index page on > http://localhost:3000/site/index the action works just fine. But if I > use the root mapping, http://localhost:3000 and then do the search, it > will complain that there is no route found for GET on /search.Well, you need to point it in the right direction. did you create route for /search? or you could do this action="site/search" -- 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 -~----------~----~----~----~------~----~------~--~---
alexey.Creopolis
2007-Sep-02 10:08 UTC
Re: no route found to match "/search" with {:method=>:get}
hm, if i am understand you need implement routes, in config/routes.rb, something in middle do: map.search "/search", :controller => "site", :action => "index" then /search path will be available, for anything. also you will be able to make restful url, like: link_to "Seach on site", search_url On Aug 29, 8:07 pm, bashar <bashar.abdul...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am a bit new to the whole RoR thing and have faced small problem, > but was not able to fine related answer to my specific condition. I am > writing an application called site which I want to be the default root > application. I did the required configuration in routes.rb file. > > Problem is, on the main page, I have a GET form that does not wrap > object model, and has an id. I tried manual HTML and it didn''t work > when I am visiting the site fromhttp://localhost:3000because the > action ''search'' will point to non-existing action on that level, > yielding error: > > no route found to match "/search" with {:method=>:get} > > if I go tohttp://localhost:300/site/indexand do the search it works > fine. I tried the form_tag and it also didn''t help. Any idea how I can > overcome this issue?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jamal: Thanks. Your solution worked. Alexey: Your solution worked as well. Thanks. I think I will go with the name mapping seems better on the long run. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
JN_Coward
2007-Sep-02 11:55 UTC
Re: no route found to match "/search" with {:method=>:get}
you are missing the slash in front of search, it should be: <form id="searchbox_012963" action="/search"> not <form id="searchbox_012963" action="search"> /Jonas On 2 Sep, 06:43, Bashar Abdullah <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Salam Jamal, > > There is nothing much to see in the controller, but rather here is a > snippet from the view index generating the GET request: > > <form id="searchbox_012963" action="search"> > <input name="q" type="text" size="40" /> > <input type="submit" name="sa" value="Search" /> > </form> > > Now problem is when I visit the index page onhttp://localhost:3000/site/indexthe action works just fine. But if I > use the root mapping,http://localhost:3000and then do the search, it > will complain that there is no route found for GET on /search. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Thanks Jonas. I tried that before it didn''t work. The solution from Jamal and Alexey worked. On Sep 2, 2:55 pm, JN_Coward <jonas.nick...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> you are missing the slash in front of search, it should be: > > <form id="searchbox_012963" action="/search"> > > not > > <form id="searchbox_012963" action="search"> > > /Jonas > > On 2 Sep, 06:43, Bashar Abdullah <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Salam Jamal, > > > There is nothing much to see in the controller, but rather here is a > > snippet from the view index generating the GET request: > > > <form id="searchbox_012963" action="search"> > > <input name="q" type="text" size="40" /> > > <input type="submit" name="sa" value="Search" /> > > </form> > > > Now problem is when I visit the index page onhttp://localhost:3000/site/indextheaction works just fine. But if I > > use the root mapping,http://localhost:3000andthen do the search, it > > will complain that there is no route found for GET on /search. > > > -- > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---