werein / x-editable-rails

Edit fields easily with X-Editable helper

Home Page:https://wereinhq.com/guides/x-editable-rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error msg is not working

tho068 opened this issue · comments

I have tried rendering it like this:
render :json => "{'errors' : #{@device.errors.to_json}", status: :unprocessable_entity

and
render :json => "{'errors' : #{@device.errors.to_json}}", status: :unprocessable_entity

and

    render :json => @device.errors, status: :unprocessable_entity

All of these gives an error in the javascript console, saying that response.responseJSON is undefined, and error msgs does not render.

soved it by using this

    render json: {errors: @device.errors}, status: :unprocessable_entity