Sha256: 8306f3d7fe9e834846d6a094f18125f7ce04a7d757fedd5918e15ecf426df468

Contents?: true

Size: 1.26 KB

Versions: 15

Compression:

Stored size: 1.26 KB

Contents

= ECM User Area


= Installation

Add it to your Gemfile:

  # Gemfile
  gem 'ecm_user_area2'

Install:

  rails g ecm:user_area:install

Add Migrations and migrate:

  rake ecm_user_area:install:migrations && rake db:migrate

Optionally, create a default user (user@example.com/password):

  rake ecm:user_area:create_default_user
  
Add routes:

  # config/routes.rb
  mount Ecm::UserArea::Engine, at: '/auth'

Add current_user helpers to your application controller:

  # app/controllers/application_controller.rb
  include Controller::RedirectBackConcern
  include Controller::CurrentUserConcern


= Usage

to secure a controller, add following before_action:

  # app/controllers/my_secure_controller.rb
  before_action :authenticate_user!

When you visit any controller actions, you will be redirected to the sign in form.


= Adding helper methods

  # app/controllers/application_controller.rb
  include Controller::CurrentUserConcern

This gives you #current_user_session, #current_user, user_signed_in?


= Using the navigation helper

  # app/controllers/application_controller.rb
  helper Ecm::UserAreaHelper


= Running Specs

    gem install bundler
    bundle
    cd spec/dummy && rake db:migrate RAILS_ENV=test && cd ../..
    guard

This project rocks and uses MIT-LICENSE.

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ecm_user_area2-3.1.2 README.rdoc
ecm_user_area2-3.1.1 README.rdoc
ecm_user_area2-3.1.0 README.rdoc
ecm_user_area2-3.0.3 README.rdoc
ecm_user_area2-3.0.2 README.rdoc
ecm_user_area2-3.0.1 README.rdoc
ecm_user_area2-3.0.0 README.rdoc
ecm_user_area2-2.3.0 README.rdoc
ecm_user_area2-2.2.0 README.rdoc
ecm_user_area2-2.0.0 README.rdoc
ecm_user_area2-1.2.10 README.rdoc
ecm_user_area2-1.2.9 README.rdoc
ecm_user_area2-1.2.8 README.rdoc
ecm_user_area2-1.2.6 README.rdoc
ecm_user_area2-1.0.3 README.rdoc