I have a problem with getting the error messages from:
format.json { render json: @contactmail.errors, status: :unprocessable_entity }
to my real-time JQuery validation of some text-fields.
When the JQuery method datatype is set to text it prints out all the html of the page I want to validate after render new page. If datatype is JSON Firebug gives me an error 422 and prints something that resembles objects with my error mess开发者_C百科ages.
Any clue to how to do this the correct way?
精彩评论