Sha256: 923798a50cf3e54ff9480f10deb073c9764cfbf0962911c013c6ee477e5ba749

Contents?: true

Size: 997 Bytes

Versions: 2

Compression:

Stored size: 997 Bytes

Contents

class Clearance::UsersController < ApplicationController
  unloadable

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

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

  def create
    @user = ::User.new params[:user]
    if @user.save
      ::ClearanceMailer.deliver_confirmation @user
      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
    signin_url
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tonkapark-clearance-0.6.9.2 app/controllers/clearance/users_controller.rb
tonkapark-clearance-0.6.9.3 app/controllers/clearance/users_controller.rb