maybe i'm completely confused about what you're trying to do, but application-controller says the following: # Filters added to this controller apply to all controllers in the application. # Likewise, all the methods added will be available for all controllers.
that's right, but you didn't mention you were trying to write a plugin. in that case try to write it like this:
# my_plugin.rb: module MyPlugin def my_action end end
# init.rb: ActionController::Base.send :include, MyPlugin
hope i didn't forget anything.
sorry, just checked it. i gotta be like this:
# my_plugin.rb: module MyPlugin def self.included(base) base.extend(ClassMethods) end
module ClassMethods def my_action # ... end end end
irb(MyOtherController):001:0> MyOtherController.methods.include? ('my_action') => true