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.
John Stackhouse (Guest)
on 2006-03-08 23: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
Ben M. (Guest)
on 2006-03-09 05:29
(Received via mailing list)
Look in your development log...

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