Created
June 27, 2017 18:58
-
-
Save ryenski/84739200f4f3941df1bb5ae9a15553c1 to your computer and use it in GitHub Desktop.
Calling TenantCreator service object in SignupController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignupsController < ActionController::Base | |
def create | |
@signup = TenantCreator.new(signup_params) | |
if @signup.call | |
redirect_to welcome_url(account_id: @signup.tenant.subdomain, auth_token: @signup.user.auth_token) | |
else | |
flash.now[:error] = @signup.errors.full_messages.join(', ') | |
render action: :index | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment