Jbuilder turn & in \

I have a jbuilder template that makes a json representation of one of my models as follows:

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

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

Is there a way to get jbuilder to stop messing with my ampersands? thank

+4
source share
1 answer

So, it turns out that as soon as I analyze JSON on the other hand, you will be returned again, and in fact it does not matter.

-3
source

Source: https://habr.com/ru/post/1533868/


All Articles