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
#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 26 27 28 |
# 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" post_signup_url = attrs.post_signup_url.or('/') # On a successful signup, then login Volt.login(login, password).then do # Redirect to post signup url go post_signup_url 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
30 31 32 33 |
# File 'app/user-templates/controllers/signup_controller.rb', line 30 def use_username? auth = Volt.config.auth auth && auth.use_username end |