title: Cakephp parameters not passing
body: <p>I've spent a bunch of time trying to figure this problem out and had zero luck. I have tried routing with no success. I'll put the logic first then the code. </p>
  
  <blockquote>
    <ol>
    <li>Users are in /pra/Fields/view/1 looking at a list of fields where fields.template_id=1</li>
    <li>Users click add new field /pra/Fields/add_new/1 they are brought to a form where they enter the information they want to
    about the new field they create.       </li>
    <li>when a user clicks on add/submit, the new field is saved to the database </li>
    <li>The user is taken back to /pra/Fields/view/1 so they can see the new field added to the template</li>
    </ol>
  </blockquote>
  
  <p>currently the first 3 steps are happening, however when it comes to redirecting back to <code>/pra/Fields/view/1</code> The user is being redirected to <code>/pra/Fields/view/</code></p>
  
  <p>here is the code for the add_new function</p>
  
  <pre><code>function add_new($id=null){
      //allows users to add another field to an existing template
      $this-&gt;set('title_for_layout', 'Create Fields');
      $this-&gt;set('stylesheet_used', 'homestyle');
      $this-&gt;set('image_used', 'eBOXLogoHome.png');
      $this-&gt;layout='home_layout';
      $name=$this-&gt;Field-&gt;field('template_id', array('template_id'=&gt;$id));
      //if the field data saves
      $this-&gt;set('name',$name);
      if(($this-&gt;Field-&gt;save($this-&gt;data)))
      {   
          //user is redirected to fields/view/$name
          $this-&gt;redirect(array('controller'=&gt;'Fields', 'action'=&gt;'view',$name));
      }
      //sets the $id variable
      $this-&gt;set('id',$id);
  </code></pre>
  
  <p>here is the add_new view</p>
  
  <pre><code>&lt;table id="formatform"&gt;
          &lt;/br&gt;&lt;/br&gt;
          &lt;?php
              $options = array('Money'=&gt;'Money','Text'=&gt;'Text','Description'=&gt;'Description');
              ?&gt;
          &lt;?php echo $this-&gt;Form-&gt;create('Field', array('action'=&gt;'add_new')); ?&gt;
          &lt;?php echo $this-&gt;Form-&gt;input('id',array('type'=&gt;'hidden')); ?&gt;
                  &lt;tr&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $this-&gt;Form-&gt;input('template_id',array('type'=&gt;'hidden','default' =&gt; $id)); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                  &lt;td align='center'&gt;Field Name:&lt;/td&gt;
                  &lt;td align='left'&gt;&lt;?php echo $this-&gt;Form-&gt;input('name', array('label'=&gt;false)); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                  &lt;td align='center'&gt;Default Value:&lt;/td&gt;
                  &lt;td align='left'&gt;&lt;?php echo $this-&gt;Form-&gt;input('default_value', array('label'=&gt;false)); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                  &lt;td align='center'&gt;Field Type:&lt;/td&gt;
                  &lt;td align='left'&gt;&lt;?php echo $this-&gt;Form-&gt;input('field_type', array('label'=&gt;false,'type'=&gt;'select','options'=&gt;$options)); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                  &lt;td align='center'&gt;Description:&lt;/td&gt;
                  &lt;td align='left'&gt;&lt;?php echo $this-&gt;Form-&gt;input('description', array('label'=&gt;false)); ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $this-&gt;Form-&gt;input('active', array('type'=&gt;'hidden','default'=&gt;true)); ?&gt;&lt;/td&gt;
                  &lt;/tr&gt;
  
  
  
  
      &lt;td&gt;&lt;/td&gt;   &lt;td align = "left"&gt;&lt;?php echo $this-&gt;Form-&gt;end('Submit');?&gt;&lt;/td&gt;
  </code></pre>
  
  <p>and here is the view function code</p>
  
  <pre><code>function view($name){
      //lists information about fields that correspond to the
      //template they have clicked 'view' on
      $this-&gt;set('title_for_layout', 'Field Details');
      $this-&gt;set('stylesheet_used', 'homestyle');
      $this-&gt;set('image_used', 'eBOXLogoHome.png');
      $this-&gt;layout='home_layout';
      //sets $conditions where template_id=$name and field.active=true
      $conditions=array(
          "AND"=&gt;array(
          'template_id'=&gt; $name,
          'Field.active'=&gt;true));
      //finds all fields where 'conditions'=$conditions
      $fields = $this-&gt;Template-&gt;Field-&gt;find('all',array( 
          'conditions' =&gt; $conditions));
      //sets all the variables      
      $this-&gt;set('conditions', $conditions);
      $this-&gt;set('field', $fields);
      $this-&gt;set('field', $this-&gt;paginate('Field', $conditions));  
  
  
  }
  </code></pre>