controller.before_filter do |c| # c is an instance of controller
though since you can always get from a controller instance to its
class’s name easily (self.class.name), you don’t really need to store
Can you explain a little more what you want to happen?
So I gave that a try and didn’t quite work but came closer!
In the meantime… We have a database guy and a programmer, that’s me!
The database guy wants it to be ‘normalized’, HA right! Well to do that
we have the same information for controllers in different tables which
mean different models. So we have MenuWidget and ForumWidget (there are
several types of widgets)
But they all do the same thing in the before filter so I need the class
name so i can dynamically call the appropriate tables. The @test was a
simpler test i was using what I really have is something like.
@problem_here = Security.new(controller.name)
@@name = nil
def initialize controller
@@name = controller.name
so the Security class works dandy, it is getting the instance of the
security class to stick around. I got it to work fine by storing the
variable inside the controller itself, but I really need to get it into
the module eventually.
the problem is I also need to use the variable in the controller as well
class MenuController < …
Anyway thank you very much I will continue to fool around with
instance_variable_set! Hope the new information helped and did not