title: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id .. amistad views?
body: <p>I am using amistad as a friends controller. now I want to add friend but the error I get is :</p>
  
  <pre><code>Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id..
  </code></pre>
  
  <p>this is my link to add friend :</p>
  
  <pre><code>&lt;section&gt;
        &lt;h1&gt;
          &lt;%= @user.username %&gt;
        &lt;/h1&gt;
  
      &lt;% unless current_user == @user  %&gt;
  &lt;%= link_to "Arkadaşlarıma Ekle", friends_path(:friend_id =&gt; @user), :method =&gt; :post,class: "btn btn-large btn-primary" %&gt;
      &lt;%end %&gt;
        &lt;/section&gt;
  </code></pre>
  
  <p>and my friendships_controller.rb:</p>
  
  <pre><code>class FriendshipsController &lt; ApplicationController
  
    before_filter :authenticate_user!
  
    def index
      @friends = current_user.friends
      @pending_invited_by = current_user.pending_invited_by
      @pending_invited = current_user.pending_invited
    end
  
    def new
      @users = User.all :conditions =&gt; ["id != ?", current_user.id]
    end
  
    def create
      invitee = User.find_by_id(params[:user_id])
      if current_user.invite invitee
        redirect_to new_friend_path, :notice =&gt; "Successfully invited friend!"
      else
        redirect_to new_friend_path, :notice =&gt; "Sorry! You can't invite that user!"
      end
    end
  
    def update
      inviter = User.find_by_id(params[:id])
      if current_user.approve inviter
        redirect_to new_friend_path, :notice =&gt; "Successfully confirmed friend!"
      else
        redirect_to new_friend_path, :notice =&gt; "Sorry! Could not confirm friend!"
      end
    end
  
    def requests
      @pending_requests = current_user.pending_invited_by
    end
  
    def invites
      @pending_invites = current_user.pending_invited
    end
  
    def destroy
      user = User.find_by_id(params[:id])
      if current_user.remove_friendship user
        redirect_to friends_path, :notice =&gt; "Successfully removed friend!"
      else
        redirect_to friends_path, :notice =&gt; "Sorry, couldn't remove friend!"
      end
    end 
  
  end 
  </code></pre>
  
  <p>how can i arrange the correct views for amistad ? is there a tutorial?</p>