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; margin: 0;
padding: 0; padding: 0;
&.menu-right {
float: right;
.menu-item {
&:hover {
background-color: red;
color: white;
}
&:last-child {
border-right: 0;
}
}
}
.menu-item { .menu-item {
border-right: 1px dotted $border-color; border-right: 1px dotted $border-color;

View file

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

View file

@ -17,3 +17,5 @@
= link_to user_notifications_path(User.zeus), class: 'menu-item' do = link_to user_notifications_path(User.zeus), class: 'menu-item' do
Zeus Notifications Zeus Notifications
%span.badge= User.zeus.notifications.size %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' omniauth_callbacks: 'callbacks'
} }
devise_scope :user do
delete '/sign_out', to: 'devise/sessions#destroy'
end
authenticated :user do authenticated :user do
root 'pages#landing', as: :authenticated_root root 'pages#landing', as: :authenticated_root
end end