Sinatra - Ajax Web Form Problems

Hello all, I'm hoping someone could help me I'm really getting nowhere
with this.

I have a form that submits info to a mysql database and it seems to
work. The data is submitted but my problem is with the ajax. Once
submitted I'd like the form to disappear and a "success" message to show
up but I'm having problems. Here is the code from my Sinatra app.

class Contact
  include DataMapper::Resource
  property :id, Serial
  property :full_name, String
  property :email, Text
  property :subject, Text
  property :body, Text
  property :date, DateTime

  # database.table_exists?(Contact) or

Try returning something other than a redirect. The onSuccess callback
will only be executed if the response code is a success (200) and im
not sure if it will run the onSuccess when the response is a redirect

Hey Kyle, thanks for the tip but that didn't seem to work. When
onSuccess it doesn't work, nothing happens when I hit the submit button
when I use chrome or firefox.