title: Passing argument from view of one resource to create method of another with Laravel
body: <p>I have a questions resource and an answers resource. From the questions index I want there to be a link under each question called answer which when clicked takes you to the create answer form.  The id of the question being answered needs to be passed with it to the answers.create method which then creates the create answers view with the questions id as a hidden field.</p>
  
  <p>here is the relevant part of questions index</p>
  
  <pre><code> @foreach($questions as $question)
  
         {{ $question-&gt;question }} &lt;/br&gt;
  
         {{ HTML::linkRoute('medicalanswers.create', 'Answer', $question-&gt;id) }}
  
   @endforeach
  </code></pre>
  
  <p>this creates a link like this </p>
  
  <pre><code>http://localhost:8888/medicalanswers/create?2 
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>http://localhost:8888/medicalanswers/create/2
  </code></pre>
  
  <p>so that is problem number one but even when I enter that link manually I get a notfoundhttpexception from routing</p>
  
  <p>here is my answers controller method</p>
  
  <pre><code>/**
       * Show the form for creating a new resource.
       *
       * @return Response
       */
      public function create($qid)
      {
          return View::make('medicalanswers.create')
              -&gt;with('questionid', $qid);
      }
  </code></pre>
  
  <p>and my routes.php file</p>
  
  <pre><code>Route::get('/', array('as' =&gt; 'home', function()
  {
      return View::make('layouts.default');
  }));
  
  Route::get('users/login', 'UsersController@getLogin');
  Route::get('users/logout', 'UsersController@getLogout');
  
  Route::post('users/login', 'UsersController@postLogin');
  
  Route::resource('users', 'UsersController');
  
  Route::resource('images', 'ImagesController');
  //routes related to images
      Route::post('images/toalbum/{id}', array('as' =&gt; 'imgToAlbum', 'uses' =&gt; 'ImagesController@addImageToAlbums'));
  
  Route::resource('videos', 'VideosController');
  
  Route::resource('albums', 'AlbumsController');
  
  Route::resource('measurements', 'MeasurementsController');
  
  Route::resource('medicalquestions', 'MedicalquestionsController');
  
  Route::resource('medicalanswers', 'MedicalanswersController');
  </code></pre>