Forum: Ruby on Rails displaying database errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E81ae027925dca383763c78369780a75?d=identicon&s=25 John Stackhouse (Guest)
on 2006-03-08 22:02
hi,

Does anyone out there know how to display database creation errors?
I've got a system to track tasks, here's the create code:

  def create
    @task = Task.new(params[:task])
    if @task.save
      flash[:notice] = 'Task was successfully created.'
      redirect_to :action => 'list'
    else
      flash[:notice] = 'Error saving task!'
      render :action => 'new'
    end
  end

I'm getting the "Error saving task!" error, but I can't figure out what
the problem is.  Any way to dump the SQL error?

Thanks,
-John
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-03-09 04:29
(Received via mailing list)
Look in your development log...

b
This topic is locked and can not be replied to.