title: passing object across controllers in grails
body: <p>I have the domain classes <code>TestUnit</code>, <code>TestParameter</code> and <code>ParameterRange</code> as shown below.</p>
  
  <pre><code>class TestUnit {
      static hasMany = [testParameters : TestParameter]
  }
  
  class TestParameter {
      static hasMany = [paramRanges : ParameterRange ]
      static belongsTo = [testUnit : TestUnit]
  }
  
  class ParameterRange {
      static belongsTo = [testParam : TestParameter]
  }
  </code></pre>
  
  <p>I want to add the <code>TestUnit</code> object (i.e, <code>testUnitInstance.id</code>) in the <code>ParameterRangeController</code>.</p>
  
  <p>Since i'm new to grails i don't know how to do that could anyone please explain it to me?</p>
  
  <p>What I've tried:</p>
  
  <pre><code>def testUnitId = params.testUnitId 
  def testUnitInstance = TestUnit.get(testUnitId) 
  def testParameterInstance = TestParameter.get(params.id) 
  [parameterRangeInstanceList: testParameterInstance.paramRanges, parameterRangeInstance: new ParameterRange(),testParameterInstance:testParameterInstance, page:"Range", testUnitInstance:testUnitInstance]
  </code></pre>