bogdan/ajaxsubmit — pull request #1 by allenlsy (2013-12-17 03:43:55+00:00)
Title: To adapt Rails better

Hi Bodgan, I used this your library for several months. But I sent this pull request late. I work on Rails apps, thus my changes are related to working with Rails better and easier.

* Line 15: I forgot why I changed line 15, but it seems working fine with my Rails App.
* Line 106: Easier for Rails to send back error message response using `format.json`.

For example:

```ruby
format.json do
if correct
render json: { redirect: root_path }
else
render json: { errors: @errors }
end
end
```