Skip to content

@knaveofdiamonds /gist:1601522 forked from jccarbonfive/gist:1575869
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
class UsersController < ApplicationController
def new
@user = User.new
end
def create
@user = User.new params[:user]
@user.save
format.html do
email = EmailService.welcome_email user
email.deliver
redirect_to @user
end
format.json do
render :json => @user,
:status => :created,
:location => @user
end
end
end
class EmailService
def self.welcome_email(user)
email = UserMailer.welcome_email user
email.deliver
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.