views:

53

answers:

1

Hi

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?

+1  A: 

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

map.resource :user, :collection => {:logout => :get}
MBO
im not too familiar with these (all i know is that what you suggested worked - so I thank you) where can I learn more pls?thx again!!!
Lily
@Lily That part was from documentation: <http://api.rubyonrails.org/classes/ActionController/Resources.html#M000523>. I think there is no good tutorial to get all that things, check example applications on github and search documentation <http://rubyonrails.org/documentation>.For that part about resources, you should remember that rails only give you mapping for `index`,`new`,`create`,`edit`,`update` and `delete` methods, all other you need to specify by youself
MBO
thank you so much!
Lily
@Lily: If this answer worked for you, why not vote it up and mark it as an answer?
nathanvda