It''s more of a Ruby question than Rails specifically, but anyway... I''m trying to make a generic filter that could be customized with options (it''s for authorization, but that doesn''t matter). Currently I see two sensible approaches: before_filter { |controller| controller.authorize_filter(OPTIONS) } where authorize_filter is a controller''s method and does the work depending on options, and: before_filter(&create_authorizator(OPTIONS)) where create_authorizator returns a Proc object. I have implemented the second one since, depending on OPTIONS, the resulting filters may be quite different, so I''m returning different blocks of code. The problem is that Proc returned by create_authorizator doesn''t have access to protected methods of controller (obvious). The first solution seems less elegant to me, but since it can use protected methods I''ll have to switch to it. Do you know of any other/better ways of achieving something similar? -- Marcin Simonides -- 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 -~----------~----~----~----~------~----~------~--~---