Created
February 28, 2009 02:47
-
-
Save hidenowt/71847 to your computer and use it in GitHub Desktop.
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
# /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