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? Attachments: http://www.ruby-forum.com/attachment/3089/application.rb -- 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-/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 -~----------~----~----~----~------~----~------~--~---
This post might help: http://rails.lighthouseapp.com/projects/8994/tickets/946-pass-blocks-to-beforeafter-filter-methods-using-with-option On Dec 19, 11:58 am, Scott Peterson <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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. > > 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? > > Attachments:http://www.ruby-forum.com/attachment/3089/application.rb > > -- > Posted viahttp://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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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> 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? > > Attachments: > http://www.ruby-forum.com/attachment/3089/application.rb > > -- > 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-/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 -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- Setting a global before_filter action in application.rb
- before_filter application => exclude some other controllers
- Why before_filter is not working?
- Passing Arguments to before_filter
- UserEngine -- Permission.synchronize_with_controllers -- trouble with my own controller modules