Skip to content

Instantly share code, notes, and snippets.

@ryenski
Created June 27, 2017 18:58
Show Gist options
  • Save ryenski/84739200f4f3941df1bb5ae9a15553c1 to your computer and use it in GitHub Desktop.
Save ryenski/84739200f4f3941df1bb5ae9a15553c1 to your computer and use it in GitHub Desktop.
Calling TenantCreator service object in SignupController
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