In my routes.rb file, I have the following:
controller :sessions do
get 'login' => :new
post 'login' => :create
delete 'logout' => :destory
end
And in a view file, I have this link:
<%= link_to 'Logout', logout_url, :method => :delete%>
But when click the Logout link, I get this error
Unknown action
The action 'destory' could not be found for SessionsController
Your route is fine, the problem is that your
SessionsControllerhas nodestroyaction definedActually, I just noticed, your route has
destoryinstead ofdestroy