Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 998 Bytes

devise.md

File metadata and controls

34 lines (24 loc) · 998 Bytes

Install and configure Devise

Install and configure following the Devise Getting Started Guide.

Protect Carnival Routes in a Devise Authenticated scope

devise_for :users
authenticate :user do
  mount_carnival_at '/'
  resources :people
end

Customize Header to add CurrentUser info and SignOut link

Create a partial "carnival/_extra_header.html.haml(erb)" in your views folder

E.g. Extra Header Partial

Sample content:

%div.sign_out= link_to t('logout'), destroy_user_session_path, :method => :delete
%div.salute
  = link_to "edit_admin_user_path(current_user.id)" do
    .email
      = current_user.email
    %figure
      = image_tag "", :class => "default"

Rendered Header: Extra Header Rendered