Sha256: b208c6dbf6a481d2f7e810ca64eca0a569b4e0cb0134d02e11eb1103fec2ee3c

Contents?: true

Size: 1.18 KB

Versions: 42

Compression:

Stored size: 1.18 KB

Contents

module Virgo
  class Users::RegistrationsController < ::Devise::RegistrationsController
    skip_before_filter :require_no_authentication

    def new
      build_resource({})
      respond_with self.resource
    end

    # POST /resource
    def create
      self.resource = build_resource(sign_up_params)

      if resource.save

        if resource.active_for_authentication?
          set_flash_message :notice, :signed_up if is_navigational_format?
          sign_up(resource_name, resource)

          if params[:next].present?
            redirect_to(params[:next]) and return
          else
            redirect_to(virgo.root_path) and return
          end
        else
          set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
          expire_session_data_after_sign_in!
          respond_with resource, :location => virgo.after_inactive_sign_up_path_for(resource)
        end
      else
        clean_up_passwords resource
        respond_with resource
      end
    end

    def sign_up_params
      params.require(:user).permit(:username, :nickname, :email, :first_name, :last_name, :password,
        :password_confirmation)
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
virgo-0.3.17 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.16 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.15 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.14 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.13 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.12 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.11 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.10 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.9 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.8 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.7 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.6 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.4 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.3 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.2 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3.1 app/controllers/virgo/users/registrations_controller.rb
virgo-0.3 app/controllers/virgo/users/registrations_controller.rb
virgo-0.2.9 app/controllers/virgo/users/registrations_controller.rb
virgo-0.2.8 app/controllers/virgo/users/registrations_controller.rb
virgo-0.2.7 app/controllers/virgo/users/registrations_controller.rb