Forum: Ruby on Rails before_filter for a specific controller/action

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.
Ff3c3206118733da78f58d749a5e4311?d=identicon&s=25 Scott Peterson (golddog)
on 2008-12-19 20:58
Attachment: application.rb (786 Bytes)
I'm learning about before_filter, implementing a simple "you must be
logged on" thing.

It works great, but I need to allow people to create a player as well.

By writing the except as attached, that works, but then everyone has
access to all "new" methods, which I don't really want.

Can someone help me with how to properly construct this to limit
non-logged in access to the new method of the players controller?
8f72e436a3107703e6ee950512036598?d=identicon&s=25 shenry (Guest)
on 2008-12-19 21:29
(Received via mailing list)
This post might help:

http://rails.lighthouseapp.com/projects/8994/ticke...

On Dec 19, 11:58 am, Scott Peterson <rails-mailing-l...@andreas-s.net>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-12-19 22:52
(Received via mailing list)
On 19 Dec 2008, at 19:58, Scott Peterson wrote:

>
> I'm learning about before_filter, implementing a simple "you must be
> logged on" thing.
>
> It works great, but I need to allow people to create a player as well.
>
stick
skip_before_filter :foo, :only => :new
in PlayersController

Fred
This topic is locked and can not be replied to.