title: Unable to work with FOSRestBundle
body: <p>I am trying to use Symfony2 and FOSRestBundle to come up with a REST framework and I am failing miserably.</p>
  
  <p>I have done the following:</p>
  
  <p>in my deps file:</p>
  
  <pre><code>[FOSRest]
      git=git://github.com/FriendsOfSymfony/FOSRest.git
      target=fos/FOS/Rest
  
  [FOSRestBundle]
      git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
      target=bundles/FOS/RestBundle
  
  [JMSSerializerBundle]
      git=git://github.com/schmittjoh/JMSSerializerBundle.git
      target=bundles/JMS/SerializerBundle
  </code></pre>
  
  <p>In my apps/config.yml</p>
  
  <pre><code>fos_rest:
      view:
          formats:
              rss: true
              xml: false
          templating_formats:
              html: true
          force_redirects:
              html: true
          failed_validation: HTTP_BAD_REQUEST
          default_engine: twig
  
  
  sensio_framework_extra:
      view:
          annotations: false
  </code></pre>
  
  <p>In my Controller:</p>
  
  <pre><code>namespace Rest\WebServiceBundle\Controller;
  
  use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  use FOS\RestBundle\View\View;  
  
  
  class DefaultController extends Controller
  {
  
      public function indexAction($name)
      {
  
  
    $view = View::create()
            -&gt;setStatusCode(200)
            -&gt;setData($name);
          return $this-&gt;get('fos_rest.view_handler')-&gt;handle($view);
  
  
      }
  }
  </code></pre>
  
  <p>When I go to the URL: <a href="http://local.symfony.com/web/app_dev.php/hello/test" rel="noreferrer">http://local.symfony.com/web/app_dev.php/hello/test</a></p>
  
  <p>I get:</p>
  
  <pre><code>Unable to find template "".
  500 Internal Server Error - InvalidArgumentException
  2 linked Exceptions: Twig_Error_Loader » Twig_Error_Loader
  </code></pre>
  
  <p>The documentation seems confusing to me and I am unable to continue. All I want is to be able to pass an array of data to the controller and get back a JSON format. Can someone help?</p>