the last_updated field will be handled by rails automatically if you use
updated_at/on however to solve the other problem more info would be a
help.
specifically
the controller/model/view that your working with
Keynan:
Thanks very much for your help. I’ve been able to get the “created_on”
and “last-updated” working now, but I still can’t get the “duedate”
working. I wonder if it’s becuase the input that I’m feeding it is not
a full timestamp, but only the date in various formats (even text input
02/09/2007, e.g.)
That being said, here’s the relevant controller code:
@goal = Goal.new(params[:goal])
#store the userid for this goal @goal.entity_id = session[:user].id @goal.last_updated = Time.now
if @goal.save
tags.each {|tag| @goal.tags << Tag.find_or_create_by_name(tag)}
@goalhist.goal_id = @goal.id
#big if for creating the actual measurements
@goalhist.save!
flash[:notice] = 'Goal was successfully created.'
#format.html { redirect_to goal_url(@goal) }
format.html { redirect_to goals_path }
format.xml { head :created, :location => goal_url(@goal) }
else
format.html { render :action => "new" }
format.xml { render :xml => @goal.errors.to_xml }
end
end