Class: UserTemplates::SignupController

Inherits:
Volt::ModelController
  • Object
show all
Defined in:
app/user_templates/controllers/signup_controller.rb

Instance Method Summary collapse

Instance Method Details

#after_signupObject



27
28
29
30
31
32
# File 'app/user_templates/controllers/signup_controller.rb', line 27

def 
   = attrs. || '/'

  # Redirect to post signup url
  redirect_to 
end

#indexObject



3
4
5
# File 'app/user_templates/controllers/signup_controller.rb', line 3

def index
  self.model = store._users.buffer
end

#signupObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/user_templates/controllers/signup_controller.rb', line 7

def 
  # Get login and password to login
   = model.send(:"_#{User.}")
  password = model._password

  save!.then do |result|
    flash._notices << "Signup successful"

    # On a successful signup, then login
    Volt.(, password).then do
      
    end.fail do |errors|
      # Show the error (probably only the server goes down)
      flash._errors << errors.to_s
    end
  end.fail do |err|
    puts "ERR: #{err.inspect}"
  end
end

#use_username?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'app/user_templates/controllers/signup_controller.rb', line 34

def use_username?
  Volt.config.public.try(:auth).try(:use_username)
end