0.0
No commit activity in last 3 years
No release in over 3 years
ECM User Area.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Project Readme

ECM User Area¶ ↑

Installation¶ ↑

Add it to your Gemfile:

# Gemfile
gem 'ecm_user_area2'

If you don’t have devise installed, install it:

rails g devise:install

Install:

rails g ecm:user_area:install

Add Migrations and migrate:

rake ecm_user_area_engine:install:migrations && rake db:migrate

Add routes:

# config/routes.rb
Ecm::UserArea::Routing.routes(self)

Add the helpers:

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

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.

How to add a user navigation?¶ ↑

Inside a navbar:

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
  <span class="icon-bar"></span>
</button>
<div class="navbar-collapse collapse navbar-responsive-collapse">
  <%= render_user_navigation %>
</div>

You can call render_user_navigation(dropdown: true) to create a dropdown navigation

Running Specs¶ ↑

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

This project rocks and uses MIT-LICENSE.