Sha256: 01829beb8f0f7f84ad51096974d0b2e946c693526b99c05431fcd4cd10287406

Contents?: true

Size: 901 Bytes

Versions: 10

Compression:

Stored size: 901 Bytes

Contents

class Clearance::UsersController < ApplicationController
  unloadable

  skip_before_filter :authenticate, :only => [:new, :create]
  before_filter :redirect_to_root,  :only => [:new, :create], :if => :signed_in?
  filter_parameter_logging :password

  def new
    @user = ::User.new(params[:user])
    render :template => 'users/new'
  end

  def create
    @user = ::User.new params[:user]
    if @user.save
      flash_notice_after_create
      redirect_to(url_after_create)
    else
      render :template => 'users/new'
    end
  end

  private

  def flash_notice_after_create
    flash[:notice] = translate(:deliver_confirmation,
      :scope   => [:clearance, :controllers, :users],
      :default => "You will receive an email within the next few minutes. " <<
                  "It contains instructions for confirming your account.")
  end

  def url_after_create
    sign_in_url
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
janova-clearance-0.8.8 app/controllers/clearance/users_controller.rb
clearance-0.9.0.rc3 app/controllers/clearance/users_controller.rb
clearance-0.9.0.rc2 app/controllers/clearance/users_controller.rb
clearance-0.9.0.rc1 app/controllers/clearance/users_controller.rb
forgetful-clearance-0.8.11 app/controllers/clearance/users_controller.rb
forgetful-clearance-0.8.10 app/controllers/clearance/users_controller.rb
benaldred-clearance-0.8.8 app/controllers/clearance/users_controller.rb
clearance-0.8.8 app/controllers/clearance/users_controller.rb
clearance-0.8.7 app/controllers/clearance/users_controller.rb
clearance-0.8.6 app/controllers/clearance/users_controller.rb