title: Upon seemingly correct routing getting error Route not defined! - Laravel 4
body: <p>I'm developing a very basic application using Laravel 4.1 where users can signup and ask question, pretty basic stuffs. I'm now a bit confused about the restful method which would look something like this public $restful = true in laravel 3. Since then laravel has changed a lot and I got stucked with the restful idea. So I decided to leave it and go on developing the skeleton of my application. Everything went well until I created the postCreate method in my homeController to let authorized users submit their question through a form. I believe I routed the method correctly and the index.blade.php view is alright as well. I just can't figure out why I'm getting this following error even though the codes seem to be okay. </p>
  
  <pre><code>Route [ask] not defined. (View: C:\wamp\www\snappy\app\views\questions\index.blade.php)
  </code></pre>
  
  <p>If you have got what I'm doing wrong here would appreciate if you point it out with a little explanation. 
  I'm totally new in laravel 4 though had a bit of experience in the previous version. </p>
  
  <p>Here's what I have in the HomeController.php </p>
  
  <pre><code>&lt;?php
  
  class HomeController extends BaseController {
  
      public function __construct() {
  
          $this-&gt;beforeFilter('auth', array('only' =&gt; array('postCreate')));
      }
  
      public function getIndex() {
  
          return View::make('questions.index')
              -&gt;with('title', 'Snappy Q&amp;A-Home');
      }
  
      public function postCreate() {
  
          $validator = Question::validate(Input::all());
  
          if ( $validator-&gt;passes() ) {
              $user = Question::create( array (
                  'question' =&gt; Input::get('question'),
                  'user_id' =&gt; Auth::user()-&gt;id
              ));
  
              return Redirect::route('home')
                  -&gt;with('message', 'Your question has been posted!');
          }
  
          return Redirect::route('home')
              -&gt;withErrors($validator)
              -&gt;withInput();
      }
  
  }
  </code></pre>
  
  <p>this is what I have in the routes.php file </p>
  
  <pre><code>&lt;?php
  
  Route::get('/', array('as'=&gt;'home', 'uses'=&gt;'HomeController@getindex'));
  Route::get('register', array('as'=&gt;'register', 'uses'=&gt;'UserController@getregister'));
  Route::get('login', array('as'=&gt;'login', 'uses'=&gt;'UserController@getlogin'));
  Route::get('logout', array('as'=&gt;'logout', 'uses'=&gt;'UserController@getlogout'));
  
  Route::post('register', array('before'=&gt;'csrf', 'uses'=&gt;'UserController@postcreate'));
  Route::post('login', array('before'=&gt;'csrf', 'uses'=&gt;'UserController@postlogin'));
  Route::post('ask', array('before'=&gt;'csrf', 'uses'=&gt;'HomeController@postcreate')); //This is what causing the error
  </code></pre>
  
  <p>And finally in the views/questions/index.blade.php </p>
  
  <pre><code>@extends('master.master')
  
  @section('content')
  
      &lt;div class="ask"&gt;
  
          &lt;h2&gt;Ask your question&lt;/h2&gt;
  
          @if( Auth::check() )
  
              @if( $errors-&gt;has() )
                  &lt;p&gt;The following erros has occured: &lt;/p&gt;
  
                  &lt;ul class="form-errors"&gt;
                      {{ $errors-&gt;first('question', '&lt;li&gt;:message&lt;/li&gt;') }}
                  &lt;/ul&gt;
              @endif
  
              {{ Form::open( array('route'=&gt;'ask', 'method'=&gt;'post')) }}
  
                  {{ Form::token() }}
  
                  {{ Form::label('question', 'Question') }}
                  {{ Form::text('question', Input::old('question')) }}
  
                  {{ Form::submit('Ask', array('class'=&gt;'btn btn-success')) }}
  
              {{ Form::close() }}
  
          @endif
  
      &lt;/div&gt;
      &lt;!-- end ask --&gt;
  
  @stop
  </code></pre>
  
  <p>Please ask if you need any other instance of codes.</p>