Hey all,

I had a fairly simple setup for authentication that was working but wanted to add a remember me radio button. Since adding the radion button, adding a column called Auth_Token to my DB and using it to store cookies I can't seem to get my log out button to actually log the user out.

I keep receiving the following message:

ArgumentError in SessionsController#destroy

wrong number of arguments (0 for 1)


My setup is as follows:

Sessions Controller

Code:
class SessionsController < ApplicationController
	def new
	end
	
	def create
		user = User.find_by_email(params[:email])
		if user && user.authenticate(params[:password])
			if params[:remember_me]
			cookies.permanent[:auth_token]
			else
			cookies[:auth_token]
			end
			redirect_to root_url
		else
			flash.now.alert = "Invalid email or password!"
			render "signup"
		end
	end
	
	def destroy
		cookies.delete[:auth_token]
		redirect_to root_url
	end
	
end
Application Controller:

Code:
class ApplicationController < ActionController::Base
  protect_from_forgery
  
  private
  
  def current_user
    @current_user ||= User.find_by_auth_token!(cookies[:auth_token]) if cookies[:auth_token]
    end
    
  helper_method :current_user
end
Relevant element of my pages#home page:

Code:
<div class="login">
					<li><% if :current_user %>
  						<!-- user is logged in -->
  						<%= link_to "Logout", logout_path %>
						<% else %>
  					<!-- user is not logged in -->
  						<%= link_to "Login", login_path %>
						/
						<%= link_to "Sign up", signup_path %>
					<% end %></li>
				</div>

Routes File:

Code:
MadeByV2::Application.routes.draw do

    get "sessions/new"
    get "logout" => "sessions#destroy"
    
    controller :pages do
    get "home" => "pages#home"
    get "about" => "pages#about"
    get "contact" => "pages#contact"
    end
    
    controller :user do
    get "signup" => "user#new"
    end
    
    resources :users, :controller => 'user'
     
    controller :sessions do
      get "login" => "sessions#new"
      post "login" => "sessions#create"
      delete "logout" => "sessions#destroy"
    end

   root :to => "pages#home"

end
I can't seem to work out at all how to the log out button to work correctly and also ensure that in Pages#Home Logout is shown if a user is logged in and Log in/ Sign up is shown if a user isn't logged in.

Any help people can offer really would be much appreciated.

Thanks in Advance,
Tom