Hi, my question is about routing: is it possible to remove a restful action from map.resources ? if few words: I have a City model, and I''ve declared in routes.rb file: map.resources :users then I obtain ALL restful action, but I don''t need neither delete and update action. Do you know some way to remove them ? Thank you, Alessandro -- 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-/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 10, 1:51 pm, Ale Ds <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > my question is about routing: > is it possible to remove a restful action from map.resources ? > > if few words: > I have a City model, and I''ve declared in routes.rb file: > map.resources :users > > then I obtain ALL restful action, but I don''t need neither delete and > update action. > > Do you know some way to remove them ? > > Thank you, > Alessandro > -- > Posted viahttp://www.ruby-forum.com/.As far as you know you can''t. But why would you want to remove certain previously created actions from your routes? Why not just not create the delete and update methods in your controller? -- 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 Sun, Jan 10, 2010 at 2:47 PM, pharrington <xenogenesis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 10, 1:51 pm, Ale Ds <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Hi, >> my question is about routing: >> is it possible to remove a restful action from map.resources ? >> >> if few words: >> I have a City model, and I''ve declared in routes.rb file: >> map.resources :users >> >> then I obtain ALL restful action, but I don''t need neither delete and >> update action. >> >> Do you know some way to remove them ? >> >> Thank you, >> Alessandro >> -- >> Posted viahttp://www.ruby-forum.com/. > > As far as you know you can''t.Sure you can: map.resources :users, :except => [:delete, :update] there''s also an :only option -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- 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.
Perfect ! I did''t see it in the rails docs. Thank you, Alessandro DS Rick Denatale wrote:> Sure you can: > > map.resources :users, :except => [:delete, :update] > > there''s also an :only option > > -- > Rick DeNatale > > Blog: http://talklikeaduck.denhaven2.com/ > Twitter: http://twitter.com/RickDeNatale > WWR: http://www.workingwithrails.com/person/9021-rick-denatale > LinkedIn: http://www.linkedin.com/in/rickdenatale-- 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-/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.