I have a simple controller for a session. I have a link to the destroy action in that controller but I needed to create a special route for it. What I have works but I'd like to know if I am doing it the right way. Here's what I have:
In a view, there is a link:
<%= link_to "Sign Out", sessions_path, :method => :delete %>
My config/routes.rb contains
but I had to add an explicit route to get the above link to work:
delete 'sessions' => 'sessions#destroy'
So, am I doing this the right way ?
Also, I tried this but it didn't work:
resource :session, :controller => :sessions, :only => destroy
Any comments/suggestions much appreciated. Thanks.