Change after_sign_in_page to root and add sign_out button

This commit is contained in:
benji 2017-01-16 21:40:09 +01:00
parent c94738123a
commit e7d88b7083
4 changed files with 22 additions and 1 deletions

View File

@ -32,6 +32,21 @@ $color: #777;
margin: 0;
padding: 0;
&.menu-right {
float: right;
.menu-item {
&:hover {
background-color: red;
color: white;
}
&:last-child {
border-right: 0;
}
}
}
.menu-item {
border-right: 1px dotted $border-color;

View File

@ -27,6 +27,6 @@ class ApplicationController < ActionController::Base
end
def after_sign_in_path_for(resource)
current_user
root_path
end
end

View File

@ -17,3 +17,5 @@
= link_to user_notifications_path(User.zeus), class: 'menu-item' do
Zeus Notifications
%span.badge= User.zeus.notifications.size
.menu-list.menu-right
= link_to 'Sign out', sign_out_path, method: :delete, class: 'menu-item'

View File

@ -3,6 +3,10 @@ Rails.application.routes.draw do
omniauth_callbacks: 'callbacks'
}
devise_scope :user do
delete '/sign_out', to: 'devise/sessions#destroy'
end
authenticated :user do
root 'pages#landing', as: :authenticated_root
end