Sha256: 08141b536b28a7f15116484912fa1dbac214a90e2d47536e001593d261f0a898

Contents?: true

Size: 775 Bytes

Versions: 6

Compression:

Stored size: 775 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?

  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
      sign_in(@user)
      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 are now signed up.")
  end

  def url_after_create
    sign_in_url
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
clearance-0.10.5 app/controllers/clearance/users_controller.rb
clearance-0.10.4 app/controllers/clearance/users_controller.rb
clearance-0.10.3.2 app/controllers/clearance/users_controller.rb
clearance-0.10.2 app/controllers/clearance/users_controller.rb
clearance-0.10.1 app/controllers/clearance/users_controller.rb
clearance-0.10.0 app/controllers/clearance/users_controller.rb