문제

I have a jbuilder template which makes a json representation of one of my models like this:

json.(model, :id, :field1, :field2, :url)

the url includes "&"s if I just access the field from the console, but when jbuilder converts it to json the result replaces all of the "&" with \u0026 which while it is the unicode for an ampersand does work for me.

Is there a way I can get jbuilder to stop messing with my ampersands? thanks

도움이 되었습니까?

해결책

So it turns out that once I parse the JSON on the other side the \u0026s get turned back into & so it doesnt actually matter

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top