On 7 January 2011 23:25, Vilèlm <[email protected]> wrote:
> Have you tried adding the last line?
>
> def create
> �...@supplier = Supplier.new(params[:supplier])
> �[email protected]_expiry_date = @supplier.durc_issue_date + 90.days
>
> �[email protected] <-------------------THIS ONE

this is the entire code:

def create
    @supplier = Supplier.new(params[:supplier])
   @supplier.durc_expiry_date = @supplier.durc_issue_date + 90.days

    respond_to do |format|
      if @supplier.save
        format.html { redirect_to(@supplier, :notice => t('Supplier
was successfully created.')) }
        format.xml  { render :xml => @supplier, :status => :created,
:location => @supplier }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @supplier.errors, :status =>
:unprocessable_entity }
      end
    end
  end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to