Skip to content

Instantly share code, notes, and snippets.

@hidenowt
Created February 28, 2009 02:47
Show Gist options
  • Save hidenowt/71847 to your computer and use it in GitHub Desktop.
Save hidenowt/71847 to your computer and use it in GitHub Desktop.
# /controller/users_controller.rb
class UsersController < ApplicationController
#código
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
flash[:notice] = "User #{@user.name} was successfully created."
# Basta incluir esta unica linha.
Confirmation.deliver_confirmation_for_email(@user)
format.html { redirect_to(:action=>:index) }
format.xml { render :xml => @user, :status => :created, :location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
end
end
end
#código
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment