Hi All! I''m searching a good way to set some options in my Controllers; I tried defining a custom function, ie: class PeopleController < ApplicationController set_my_actions :action1, :action2 end class ApplicationController def self.set_my_actions(*args) @@my_actions = args end end But ''@@my_actions'' sets the class variable to _every_ Controllers classes! Any hints? Thanks, Marco -- Posted via http://www.ruby-forum.com/.
Maybe I don''t understand what you want to do. What''s wrong with just: class ApplicationController def foo # every controller has "foo" action end end class PeopleController < ApplicationController def bar # only people controller has "bar" action end end Marco Lazzeri wrote:> Hi All! > > I''m searching a good way to set some options in my Controllers; I tried > defining a custom function, ie: > > class PeopleController < ApplicationController > set_my_actions :action1, :action2 > end > > class ApplicationController > def self.set_my_actions(*args) > @@my_actions = args > end > end > > But ''@@my_actions'' sets the class variable to _every_ Controllers > classes! > > Any hints? > > Thanks, > Marco-- Posted via http://www.ruby-forum.com/.