title: Calling a method of another controller
body: <p>I have controllers named <code>Children</code> and <code>Father</code> and <code>Mother</code> where I need to call a method of <code>FatherController</code> and <code>MotherController</code> from <code>ChildrenController</code>.</p>
  
  <p>I need to pass a JSON data to the both controller(<strong><em>not at the same request</em></strong>) <code>get_details</code> method from <code>set_details</code> method of <code>ChildrenController</code>. I am going to call any of the controllers method based on some conditions.</p>
  
  <p>There is <strong>no route</strong> for <code>get_details</code> method in both controllers.
  I don't need any helper methods to write.</p>
  
  <p>I need to call more than one Controller's method, not by Inheriting.</p>
  
  <h1>Father controller</h1>
  
  <pre><code>class FatherController &lt; ApplicationController
  
    def get_details(data)
      ##
      ## I need to do some operation with the 'data' received from children controller.
    end
  
  end
  </code></pre>
  
  <h1>Mother controller</h1>
  
  <pre><code>class MotherController &lt; ApplicationController
  
    def get_details(data)
      ##
      ## I need to do some operation with the 'data' received from children controller.
    end
  
  end
  </code></pre>
  
  <h1>Children controller</h1>
  
  <pre><code>class ChildrenController &lt; ApplicationController
  
    data = {
        "id":"2",
        "expiry_date":"25-09-2016"
    }.as_json
  
    def set_details        
      ## get_details(data) -&gt; FatherController
      ## get_details(data) -&gt; MotherController
    end
  
  end
  </code></pre>
  
  <p>Please help how to do this or suggest me if there is any other way to do this.</p>
  
  <p>Thanks.</p>