Lilz
Lilz

Reputation: 4091

ruby on rails logging out

I am trying to create a view which allows the user to log out

So what what I've got is:

<%= link_to 'log out', :controller => "client", :action => "logout", :id => session[:id] %>

but this gives me this error:

No route matches "/client/logout/Lily" with {:method=>:get}

Any help please?

Upvotes: 0

Views: 138

Answers (1)

MBO
MBO

Reputation: 30995

Do you defined route to that action? Defned that logout is action retrieved with GET?

map.resource :user, :collection => {:logout => :get}

Upvotes: 1

Related Questions