سؤال

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