I have a link: <%= link_to_remote "Edit", {:url => edit_book_url(book)}, {:href => edit_book_url(book)} %> It produce a tag: <a href="http://localhost:3000/books/1;edit" onclick="new Ajax.Request(''http://localhost:3000/books/1;edit'', {asynchronous:true, evalScripts:true}); return false;">Edit</a> My ./config/routes.rb file is: ActionController::Routing::Routes.draw do |map| map.resources :books, :members => {:delete => :get} map.connect '':controller/service.wsdl'', :action => ''wsdl'' map.connect '':controller/:action/:id.:format'' map.connect '':controller/:action/:id'' end In log I get: ActionController::RoutingError (no route found to match "/books/1;edit" with {:method=>:post}) What''s wrong? Should I add map.connect '':controller/:id;:action''? PS. I would not like to just solve the problem. I''d like to solve it in correct way. -- I''ve probably left my head... somewhere. Please wait untill I find it. Homepage (pl_PL): http://uzytkownik.jogger.pl/ (GNU/)Linux User: #425935 (see http://counter.li.org/) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey, how about: link_to_remote "Edit", {:url => edit_book_url(book), :method => :get}, {:href => edit_book_url(book)} HTH, Trevor On 5/24/07, Maciej Piechotka <uzytkownik2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a link: > <%= link_to_remote "Edit", {:url => edit_book_url(book)}, {:href => > edit_book_url(book)} %> > > It produce a tag: <a href="http://localhost:3000/books/1;edit" > onclick="new Ajax.Request(''http://localhost:3000/books/1;edit'', > {asynchronous:true, evalScripts:true}); return false;">Edit</a> > > My ./config/routes.rb file is: > ActionController::Routing::Routes.draw do |map| > map.resources :books, :members => {:delete => :get} > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > map.connect '':controller/:action/:id.:format'' > map.connect '':controller/:action/:id'' > end > > In log I get: > ActionController::RoutingError (no route found to match "/books/1;edit" > with {:method=>:post}) > > What''s wrong? Should I add map.connect '':controller/:id;:action''? > > PS. > I would not like to just solve the problem. I''d like to solve it in > correct way. > -- > I''ve probably left my head... somewhere. Please wait untill I find it. > Homepage (pl_PL): http://uzytkownik.jogger.pl/ > (GNU/)Linux User: #425935 (see http://counter.li.org/) > > > > > >-- -- Trevor Squires http://somethinglearned.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 -~----------~----~----~----~------~----~------~--~---
A bit off-topic, but.....> map.resources :books, :members => {:delete => :get}What is this? It seems wrong. The CRUD method is destroy. Are you trying to "alias" destroy with delete? Does your custom delete method do something different than destroy? In any case the syntax looks wrong to me. It should look more like: map.resources :books, :member => { :delete => :delete } Notice ":member" is singular and you should NOT be doing ":get" if you are deleting, or modifying, the resource in any way. On May 24, 5:16 pm, Maciej Piechotka <uzytkown...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a link: > <%= link_to_remote "Edit", {:url => edit_book_url(book)}, {:href => > edit_book_url(book)} %> > > It produce a tag: <a href="http://localhost:3000/books/1;edit" > onclick="new Ajax.Request(''http://localhost:3000/books/1;edit'', > {asynchronous:true, evalScripts:true}); return false;">Edit</a> > > My ./config/routes.rb file is: > ActionController::Routing::Routes.draw do |map| > map.resources :books, :members => {:delete => :get} > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > map.connect '':controller/:action/:id.:format'' > map.connect '':controller/:action/:id'' > end > > In log I get: > ActionController::RoutingError (no route found to match "/books/1;edit" > with {:method=>:post}) > > What''s wrong? Should I add map.connect '':controller/:id;:action''? > > PS. > I would not like to just solve the problem. I''d like to solve it in > correct way. > -- > I''ve probably left my head... somewhere. Please wait untill I find it. > Homepage (pl_PL):http://uzytkownik.jogger.pl/ > (GNU/)Linux User: #425935 (seehttp://counter.li.org/)--~--~---------~--~----~------------~-------~--~----~ 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 Thu, 24 May 2007 16:21:10 -0700, Robert Walker wrote:> A bit off-topic, but..... > >> map.resources :books, :members => {:delete => :get} > What is this? It seems wrong. The CRUD method is destroy. Are you > trying to "alias" destroy with delete? Does your custom delete method > do something different than destroy? In any case the syntax looks wrong > to me. > > It should look more like: > map.resources :books, :member => { :delete => :delete } > > Notice ":member" is singular and you should NOT be doing ":get" if you > are deleting, or modifying, the resource in any way.It a hack for browser which do not have JavaScript. It will contains only button "Do you really want to delete?" which send it (unfortunatly) by POST. User click on "Delete" --> Does he have JS support? ---Yes---> Send delete | request and No gets destroy.rjs | \> He is redirect to confirmation page delete.rhtml which send request by POST. Regards -- I''ve probably left my head... somewhere. Please wait untill I find it. Homepage (pl_PL): http://uzytkownik.jogger.pl/ (GNU/)Linux User: #425935 (see http://counter.li.org/) --~--~---------~--~----~------------~-------~--~----~ 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 Thu, 24 May 2007 15:15:30 -0700, Trevor Squires wrote:> Hey, > > how about: > > link_to_remote "Edit", {:url => edit_book_url(book), :method => :get}, > {:href => edit_book_url(book)} > > HTH, > TrevorThats it. Thanks -- I''ve probably left my head... somewhere. Please wait untill I find it. Homepage (pl_PL): http://uzytkownik.jogger.pl/ (GNU/)Linux User: #425935 (see http://counter.li.org/) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---