title: Missing template relationships/create, application/create with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee]}
body: <p>I was having problem with railstutorial.org on chapter 11 with Rspec. The test was not pass.</p>
  
  <pre><code>RS-MBP:sample_app rsoutar$ bundle exec rspec spec/
  No DRb server is running. Running in local process instead ...
  Rack::File headers parameter replaces cache_control after Rack 1.5.
  FFFF.......................................................................................................................................................
  
  Failures:
  
    1) RelationshipsController creating a relationship with Ajax should increment the Relationship count
       Failure/Error: xhr :post, :create, relationship: { followed_id: other_user.id }
       ActionView::MissingTemplate:
         Missing template relationships/create, application/create with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :handlers=&gt;[:erb, :builder, :coffee]}. Searched in:
           * "#&lt;RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007fbd0c6b5910&gt;"
       # ./app/controllers/relationships_controller.rb:7:in `create'
       # ./spec/controllers/relationships_controller_spec.rb:14:in `block (4 levels) in &lt;top (required)&gt;'
       # ./spec/controllers/relationships_controller_spec.rb:13:in `block (3 levels) in &lt;top (required)&gt;'
  
    2) RelationshipsController creating a relationship with Ajax should respond with success
       Failure/Error: xhr :post, :create, relationship: { followed_id: other_user.id }
       ActionView::MissingTemplate:
         Missing template relationships/create, application/create with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :handlers=&gt;[:erb, :builder, :coffee]}. Searched in:
           * "#&lt;RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007fbd0fce9310&gt;"
       # ./app/controllers/relationships_controller.rb:7:in `create'
       # ./spec/controllers/relationships_controller_spec.rb:19:in `block (3 levels) in &lt;top (required)&gt;'
  
    3) RelationshipsController destroying a relationship with Ajax should decrement the Relationship count
       Failure/Error: xhr :delete, :destroy, id: relationship.id
       ActionView::MissingTemplate:
         Missing template relationships/destroy, application/destroy with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :handlers=&gt;[:erb, :builder, :coffee]}. Searched in:
           * "#&lt;RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007fbd0ff07d68&gt;"
       # ./app/controllers/relationships_controller.rb:16:in `destroy'
       # ./spec/controllers/relationships_controller_spec.rb:31:in `block (4 levels) in &lt;top (required)&gt;'
       # ./spec/controllers/relationships_controller_spec.rb:30:in `block (3 levels) in &lt;top (required)&gt;'
  
    4) RelationshipsController destroying a relationship with Ajax should respond with success
       Failure/Error: xhr :delete, :destroy, id: relationship.id
       ActionView::MissingTemplate:
         Missing template relationships/destroy, application/destroy with {:locale=&gt;[:en], :formats=&gt;[:js, :html], :handlers=&gt;[:erb, :builder, :coffee]}. Searched in:
           * "#&lt;RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator:0x007fbd0fc5c460&gt;"
       # ./app/controllers/relationships_controller.rb:16:in `destroy'
       # ./spec/controllers/relationships_controller_spec.rb:36:in `block (3 levels) in &lt;top (required)&gt;'
  
  Finished in 9.88 seconds
  155 examples, 4 failures
  
  Failed examples:
  
  rspec ./spec/controllers/relationships_controller_spec.rb:12 # RelationshipsController creating a relationship with Ajax should increment the Relationship count
  rspec ./spec/controllers/relationships_controller_spec.rb:18 # RelationshipsController creating a relationship with Ajax should respond with success
  rspec ./spec/controllers/relationships_controller_spec.rb:29 # RelationshipsController destroying a relationship with Ajax should decrement the Relationship count
  rspec ./spec/controllers/relationships_controller_spec.rb:35 # RelationshipsController destroying a relationship with Ajax should respond with success
  RS-MBP:sample_app rsoutar$
  </code></pre>
  
  <p>Here's the Gemfile</p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails', '3.2.12'
  gem 'bootstrap-sass', '2.1'
  gem 'bcrypt-ruby', '3.0.1'
  gem 'faker', '1.0.1'
  gem 'will_paginate', '3.0.4'
  gem 'bootstrap-will_paginate', '0.0.6'
  gem 'coffee-rails', '~&gt; 3.2.2'
  gem 'uglifier', '&gt;= 1.2.3'
  
  # Bundle edge Rails instead:
  # gem 'rails', :git =&gt; 'git://github.com/rails/rails.git'
  
  group :development, :test do
      gem 'sqlite3', '1.3.5'
      gem 'rspec-rails', '2.11.0'
      gem 'guard-rspec', '1.2.1'
      gem 'guard-spork', :github =&gt; 'guard/guard-spork'
      gem 'spork', '0.9.2'
      gem 'childprocess', '0.3.6'
  end
  
  group :development do
      gem 'annotate', '2.5.0'
  end
  
  
  # Gems used only for assets and not required
  # in production environments by default.
  group :assets do
    gem 'sass-rails',   '~&gt; 3.2.5'
  
  
    # See https://github.com/sstephenson/execjs#readme for more supported runtimes
    # gem 'therubyracer', :platforms =&gt; :ruby
  
  end
  
  gem 'jquery-rails'
  
  group :test do
      gem 'capybara', '1.1.2'
      gem 'rb-fsevent', '0.9.1', :require =&gt; false
      gem 'growl', '1.0.3'
      gem 'factory_girl_rails', '4.1.0'
      gem 'database_cleaner', '0.7.0'
  end
  
  group :production do
      gem 'pg', '0.12.2'
  end
  
  # To use ActiveModel has_secure_password
  # gem 'bcrypt-ruby', '~&gt; 3.0.0'
  
  # To use Jbuilder templates for JSON
  # gem 'jbuilder'
  
  # Use unicorn as the app server
  # gem 'unicorn'
  
  # Deploy with Capistrano
  # gem 'capistrano'
  
  # To use debugger
  # gem 'debugger'
  </code></pre>
  
  <p>Here's the relationship_controller_spec.rb</p>
  
  <pre><code>require 'spec_helper'
  
  describe RelationshipsController do
  
    let(:user) { FactoryGirl.create(:user) }
    let(:other_user) { FactoryGirl.create(:user) }
  
    before { sign_in user }
  
    describe "creating a relationship with Ajax" do
  
      it "should increment the Relationship count" do
        expect do
          xhr :post, :create, relationship: { followed_id: other_user.id }
        end.to change(Relationship, :count).by(1)
      end
  
      it "should respond with success" do
        xhr :post, :create, relationship: { followed_id: other_user.id }
        response.should be_success
      end
    end
  
    describe "destroying a relationship with Ajax" do
  
      before { user.follow!(other_user) }
      let(:relationship) { user.relationships.find_by_followed_id(other_user) }
  
      it "should decrement the Relationship count" do
        expect do
          xhr :delete, :destroy, id: relationship.id
        end.to change(Relationship, :count).by(-1)
      end
  
      it "should respond with success" do
        xhr :delete, :destroy, id: relationship.id
        response.should be_success
      end
    end
  end
  </code></pre>
  
  <p>Here's the relationship controller</p>
  
  <pre><code>class RelationshipsController &lt; ApplicationController
    before_filter :signed_in_user
  
    def create
      @user = User.find(params[:relationship][:followed_id])
      current_user.follow!(@user)
      respond_to do |format|
        format.html { redirect_to @user }
        format.js
      end
    end
  
    def destroy
      @user = Relationship.find(params[:id]).followed
      current_user.unfollow!(@user)
      respond_to do |format|
        format.html { redirect_to @user }
        format.js
      end
    end
  end
  </code></pre>
  
  <p>I don't know what else should I include in to this question.</p>
  
  <p>Thank you.</p>