> If you have any alternate solution, please provide.
I didn't go the plugin route in our application, but opted for a form of
"behavior by convention"
class GenericController < ApplicationController
# here's the standard index method
def index
blah blah blah
end
# here's a new com
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
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.
--~--~-~--~~
MaD wrote:
> 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.
From plug
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.
--~--~-~--~~---
5 matches
Mail list logo