[LRUG] [Chat] IronRuby

James Adam james.adam at gmail.com
Tue Jul 24 06:53:52 PDT 2007


On 7/24/07, Pratik Naik <pratik at thinkwares.com> wrote:
> def create
>  @person = Person.new(params[:person])
>  @person.save!
>  redirect_to :index
> rescue ActiveRecord::RecordInvalid
>   render :action => 'new'
> end

Why is that better than

  def create
    @person = Person.new(params[:person])
    if @person.save
      redirect_to :index
    else
      render :action => "new"
    end
  end

?


-- 
* J *
  ~



More information about the Chat mailing list