Sha256: 44fbb7d2ca36869961935258f557396bc707da72862b36293b17b4b7232a74d8

Contents?: true

Size: 894 Bytes

Versions: 14

Compression:

Stored size: 894 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(params[:user])
    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
    new_session_url
  end
end

Version data entries

14 entries across 14 versions & 4 rubygems

Version Path
thoughtbot-clearance-0.6.7 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.6.8 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.6.9 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.7.0 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.8.0 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.8.1 app/controllers/clearance/users_controller.rb
thoughtbot-clearance-0.8.2 app/controllers/clearance/users_controller.rb
tonkapark-clearance-0.6.9.1 app/controllers/clearance/users_controller.rb
tonkapark-clearance-0.7.0 app/controllers/clearance/users_controller.rb
vita-clearance-0.6.9.1 app/controllers/clearance/users_controller.rb
vita-clearance-0.6.9.2 app/controllers/clearance/users_controller.rb
vita-clearance-0.6.9 app/controllers/clearance/users_controller.rb
clearance-0.8.3 app/controllers/clearance/users_controller.rb
clearance-0.8.2 app/controllers/clearance/users_controller.rb