How can I get the error messages ,when there is a error happened in $.getJSON
- by psjscs
In "get_data" action ,there are some code like this:
def get_data
if params[:p]=='1'
raise "error 1"
elsif params[:p]=='2'
raise 'error 2'
else
return data
end
end
in view:
<script>
$.getJSON('/controller/get_data',function(){...})
</script>
so,when some error has raised,how can i get it!
Tks!