flaubert
2009-May-06 15:27 UTC
[ROUTES] [RAILS 2.3] Custom controller method fires a route error...
Hi all, I have a custom method in my controller called ''generate''. when requested localhost:3000/import/generate I see "Couldn''t find Import with ID=generate". How customize a route for this method? help please...
Starr Horne
2009-May-06 15:31 UTC
Re: [ROUTES] [RAILS 2.3] Custom controller method fires a route error...
On Wed, 6 May 2009 08:27:42 -0700 (PDT) flaubert <aflauberts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi all, > > I have a custom method in my controller called ''generate''. > > when requested localhost:3000/import/generate I see "Couldn''t find > Import with ID=generate". > > How customize a route for this method?map.connect ''/import/generate/'', :controller => ''import'', :action => ''generate'' -- Starr Horne Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/
flaubert
2009-May-06 15:38 UTC
Re: [ROUTES] [RAILS 2.3] Custom controller method fires a route error...
do i have to use this for any custom method that a have created? there isn''t any dryer solution for this? tnks for reply! On 6 maio, 12:31, Starr Horne <st...-wG8FsLYNbnsysxA8WJXlww@public.gmane.org> wrote:> On Wed, 6 May 2009 08:27:42 -0700 (PDT) > > flaubert <aflaube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi all, > > > I have a custom method in my controller called ''generate''. > > > when requested localhost:3000/import/generate I see "Couldn''t find > > Import with ID=generate". > > > How customize a route for this method? > > map.connect ''/import/generate/'', :controller => ''import'', :action => ''generate'' > > -- > Starr Horne > Check out my Helpdesk RailsKit:http://railskits.com/helpdesk/
Gianluca Tessarolo
2009-May-06 15:59 UTC
Re: [ROUTES] [RAILS 2.3] Custom controller method fires a route error...
try to put into config/routes.rb: map.connect '':controller/:action'' after: map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' final result: map.connect '':controller/:action/:id'' map.connect '':controller/:action/:id.:format'' map.connect '':controller/:action'' Hope this helps...> do i have to use this for any custom method that a have created? > > there isn''t any dryer solution for this? > > tnks for reply! > > On 6 maio, 12:31, Starr Horne <st...-wG8FsLYNbnsysxA8WJXlww@public.gmane.org> wrote: > >> On Wed, 6 May 2009 08:27:42 -0700 (PDT) >> >> flaubert <aflaube...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >>> Hi all, >>> >>> I have a custom method in my controller called ''generate''. >>> >>> when requested localhost:3000/import/generate I see "Couldn''t find >>> Import with ID=generate". >>> >>> How customize a route for this method? >>> >> map.connect ''/import/generate/'', :controller => ''import'', :action => ''generate'' >> >> -- >> Starr Horne >> Check out my Helpdesk RailsKit:http://railskits.com/helpdesk/ >> > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Starr Horne
2009-May-06 16:26 UTC
Re: [ROUTES] [RAILS 2.3] Custom controller method fires a route error...
On Wed, 6 May 2009 08:38:07 -0700 (PDT) flaubert <aflauberts-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> do i have to use this for any custom method that a have created? > there isn''t any dryer solution for this?The dryer solution is to use map.resource & restful urls for most actions, and use non-restful actions sparingly. -- Starr Horne Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/