diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
| -rw-r--r-- | app/models/user.rb | 9 | ||||
| -rw-r--r-- | app/views/layouts/_user_links.erb | 8 |
3 files changed, 18 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7050568de..ae953a25a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,4 @@ class ApplicationController < ActionController::Base protect_from_forgery - + before_filter :authenticate_user! end diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 000000000..b2f7c8ec9 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,9 @@ +class User < ActiveRecord::Base + # Include default devise modules. Others available are: + # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable + devise :database_authenticatable, :registerable, + :recoverable, :rememberable, :trackable, :validatable + + # Setup accessible (or protected) attributes for your model + attr_accessible :email, :password, :password_confirmation, :remember_me +end diff --git a/app/views/layouts/_user_links.erb b/app/views/layouts/_user_links.erb index 41d01375c..f82d4d7b4 100644 --- a/app/views/layouts/_user_links.erb +++ b/app/views/layouts/_user_links.erb @@ -1,5 +1,13 @@ <ul class="user"> <li class="home"><%= link_to t('layouts.home'), root_path %></li> + + <% if user_signed_in? %> + <li> | </li> + <li><%= link_to t('layouts.user.profile'), edit_user_registration_path %></li> + <li> | </li> + <li><%= link_to t('layouts.user.sign_out'), destroy_user_session_path, :method => :delete %></li> + <% end %> + <li> | </li> <li class="<%= language_class("fr") %>"><%= link_to_language :fr %></li> <li class="<%= language_class("en") %>"><%= link_to_language :en %></li> |
