Forum: Ruby on Rails :only and :except not working for map.resources

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
49de4cd2f26705785cbef2b15a9df7aa?d=identicon&s=25 Nick Hoffman (nickh)
on 2008-11-15 23:08
(Received via mailing list)
Hi guys. I'm trying to get rid of some non-existing routes. My
UserSessionsController has three methods: new, create, and destroy.
However, in routes.rb , I'm generating the 7 RESTful routes:
  map.resource :user_session

So, I thought that this would generate routes for the 3 actions that
do exist:
  map.resource :user_session, :only => [:new, :create, :destroy]

However, after adding that, ``rake routes'' still spits out the other
4 routes:
  http://rafb.net/p/kRS3DD41.html

Any idea what's going on here? Thanks,
Nick
F47bebf5f4b10b709a59310027c8f977?d=identicon&s=25 Robert Zotter (Guest)
on 2008-11-15 23:47
(Received via mailing list)
Nick,

The :except and :only routing options are only available on Edge Rails
(Rails 2.2.1 or Rails 2.2 RC2) at this time. Make sure you are running
the correct version.

Cheers

--
Robert Zotter
Zapient, LLC
Ruby on Rails Development and Consulting

http://www.zapient.com
http://www.fromjavatoruby.com
49de4cd2f26705785cbef2b15a9df7aa?d=identicon&s=25 Nick Hoffman (nickh)
on 2008-11-16 04:36
(Received via mailing list)
On Nov 15, 5:47 pm, Robert Zotter <rzot...@zapient.com> wrote:
> Zapient, LLC
> Ruby on Rails Development and Consulting
>
> http://www.zapient.comhttp://www.fromjavatoruby.com

Thanks Robert. I had no idea that was the case. I figured that the
docs at api.rubyonrails.org were applicable to the current stable
version, rather than Edge.
-Nick
49de4cd2f26705785cbef2b15a9df7aa?d=identicon&s=25 Nick Hoffman (nickh)
on 2008-11-16 05:29
(Received via mailing list)
On Nov 15, 10:35 pm, Nick <n...@deadorange.com> wrote:
> Thanks Robert. I had no idea that was the case. I figured that the
> docs at api.rubyonrails.org were applicable to the current stable
> version, rather than Edge.
> -Nick

Ack, my bad. The :except and :only options aren't listed on
api.rubyonrails.org yet. I found them in the "Rails Routing From The
Inside Out" Rails Guide:
  http://guides.rubyonrails.org/routing_outside_in.html
This topic is locked and can not be replied to.