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

Popular posts from this blog

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -