Implement user sign out (destroy current session)
This commit is contained in:
parent
7ecf47a0f9
commit
4b0f4d391f
@ -11,4 +11,9 @@ class SessionsController < ApplicationController
|
|||||||
render 'new'
|
render 'new'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
reset_session
|
||||||
|
redirect_to :root
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -13,5 +13,7 @@
|
|||||||
= link_to 'Scube', root_path
|
= link_to 'Scube', root_path
|
||||||
%li
|
%li
|
||||||
= link_to 'Playlists', playlists_path
|
= link_to 'Playlists', playlists_path
|
||||||
|
%li
|
||||||
|
= link_to 'Sign out', signout_path
|
||||||
|
|
||||||
= yield
|
= yield
|
||||||
|
@ -13,6 +13,7 @@ Rails.application.routes.draw do
|
|||||||
resources :users, only: [:new, :create]
|
resources :users, only: [:new, :create]
|
||||||
|
|
||||||
resources :sessions, only: [:new, :create]
|
resources :sessions, only: [:new, :create]
|
||||||
|
get '/signout' => 'sessions#destroy'
|
||||||
|
|
||||||
resources :tracks do
|
resources :tracks do
|
||||||
get 'download', on: :member
|
get 'download', on: :member
|
||||||
|
Loading…
x
Reference in New Issue
Block a user