Class: UserTemplates::SignupController
- Inherits:
-
Volt::ModelController
- Object
- Volt::ModelController
- UserTemplates::SignupController
- Defined in:
- app/user_templates/controllers/signup_controller.rb
Instance Method Summary collapse
Instance Method Details
#after_signup ⇒ Object
27 28 29 30 31 32 |
# File 'app/user_templates/controllers/signup_controller.rb', line 27 def after_signup post_signup_url = attrs.post_signup_url || '/' # Redirect to post signup url redirect_to post_signup_url end |
#index ⇒ Object
3 4 5 |
# File 'app/user_templates/controllers/signup_controller.rb', line 3 def index self.model = store._users.buffer end |
#signup ⇒ Object
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 signup # Get login and password to login login = model.send(:"_#{User.login_field}") password = model._password save!.then do |result| flash._notices << "Signup successful" # On a successful signup, then login Volt.login(login, password).then do after_signup 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
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 |