ruby - Rails: How to access self.method in another controller? -
class foo1 def self.foo1action(cake) # returns user object end end class foo2 def foo2action user = # here want call foo1action end end
how call foo1action in foo2action? based on rails framework. know inheriting 1 way go... want know other way of doing this..
class foo1 def self.foo_1_action(cake) end end class foo2 def foo_2_action user = ::foo1.foo_1_action(some_cake) end end
Comments
Post a Comment