On Sun, Oct 28, 2012 at 12:26 AM, Saravanan P
saravana...@shriramits.com wrote:
render :json = { :errors = @example.errors.full_messages }, :status = 422
Why are you sending a 422? If you really want to stick in the 400
range it would be more suitable to send a 409 conflict since it
literally
in your js file:
$('.form_id_or_class').live('submit', function() {
$.ajax({
url: $(this).attr(action),
type: POST,
data: $(this).serialize(),
success: function(data) {
// do some action
}
,error: function(xhr){
On Sunday, 28 October 2012 02:07:27 UTC-4, Jordon Bedwell wrote:
On Sun, Oct 28, 2012 at 12:26 AM, Saravanan P
sarav...@shriramits.com javascript: wrote:
render :json = { :errors = @example.errors.full_messages }, :status =
422
Why are you sending a 422? If you really want to stick
Hello
I am trying to show the errors that can occur by uploading a file (file
name, size).
I need have your error messages associated to the 'error' key in my json
response
else
format.html { render action: new }
format.json { render json: @upload.errors, status:
:unprocessable_entity }
in your controller:
render :json = { :errors = @example.errors.full_messages }, :status = 422
in your js file:
$('.form_id_or_class').live('submit', function() {
$.ajax({
url: $(this).attr(action),
type: POST,
data: $(this).serialize(),
success:
5 matches
Mail list logo