can not add the functionality that user has_many tokens
===

I am trying to make an application where the users have many tokens and they are able to sign up and sign in and generate tokens and its attributes but now I wish to add the functionality that one 


user "has_many tokens" and tokens "belongs_to users"


But I am not able to do so, some or the other error just stops me in mid way. These are the files:


    class TokensController < ApplicationController
    before_filter :check_for_sign_up
    before_filter :authenticate_user!, :only => [:index, :show]
    before_filter :find_token, :only => [:show,
                                         :edit,
                                         :update,
                                         :destroy]

    def index
      @tokens = Token.for(current_user).all
    end
  
    def new
      @token = Token.new
    end
  
    def create
     @token = Token.new(params[:token])
    if @token.save
      flash[:notice] = "A new Token has been generated."
      redirect_to @token
    else
      flash[:alert] = "Token has not been generated."
      render :action => "new"
      end
    end
    def 
      show
    end
  
    def 
      edit
    end
  
    def update
      if 
        @token.update_attributes(params[:token])
        flash[:notice] = "Token has been updated."
        redirect_to @token
      else
        flash[:alert] = "Token has not been updated."
        render :action => "edit"
      end
      end
  
    def destroy
      @token.destroy
      flash[:notice] = "Token has been deleted."
      redirect_to tokens_path
    end
  
    private
      def find_token
        Token.readable_by(current_user).find(params[:id])
        #@token = @user.tokens.find(params[:id])
        rescue ActiveRecord::RecordNotFound
        flash[:alert] = "The token you were looking" +
                      " for could not be found."
        redirect_to tokens_path
      end
      def check_for_sign_up
        if request.referer == user_registration_url
          redirect_to confirm_user_path
        end
      end
    end



index.html.erb


    <%= link_to "Generate new Token", new_token_path %>
    <h2>Tokens</h2> 
    <ul>
    <% @tokens.each do |token| %>
    <li><%= link_to token.action, token %></li>
    <% end %>
    </ul>



routes.rb

    Accesscards::Application.routes.draw do
      devise_for :users

      root :to => 'tokens#index'
      resources :users do
  	    resources :tokens
      end
    end





