Added "devise" for authentication.

This commit is contained in:
Christoph Haas 2015-07-15 17:06:32 +02:00
parent e6a0f15340
commit 35eb83448e
11 changed files with 410 additions and 30 deletions

View file

@ -1,2 +1,12 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
# :registerable,
# :recoverable,
# :rememberable,
:trackable,
:validatable,
:timeoutable,
:lockable
end

View file

@ -0,0 +1,6 @@
- if user_signed_in?
p Welcome #{current_user.email}
= link_to 'Logged In [click to logout]', destroy_user_session_path, :method => :delete
- else
p You are not signed in.
= link_to 'Login', new_user_session_path

View file

@ -16,6 +16,7 @@ html
// TODO: move topbar somewhere else than packages
= render 'layouts/topbar'
#messages
= render 'layouts/user_widget'
= render 'layouts/messages'
#content
= yield