Sha256: 732753d2ac616c508802d46a36b18151a3e109e18e56bdf311e30c6e5477612e

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

class UsersController < ApplicationController
  
  before_filter :authenticate_with_admin, only: 'index'
  
  def index
    @users = User.by_recent
    render layout: 'admin'
  end

  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    if @user.save
      cookies[:auth_token] = @user.auth_token
      redirect_to root_url, notice: t('authentication.signup_confirmation')
    else
      render "new"
    end
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tkh_authentication-0.0.4 app/controllers/users_controller.rb
tkh_authentication-0.0.3 app/controllers/users_controller.rb