How to safely embed JSON with [removed] in HTML document?

后端 未结 4 1959
陌清茗
陌清茗 2020-12-30 01:16

In a Rails 3.1 app, how can I safely embed some JSON data into an HTML document?

Suppose I have this in a controller action:

@tags = [
    {name:\"ta         


        
4条回答
  •  灰色年华
    2020-12-30 01:24

    btw, this works but is not a good solution in my opinion:

    
    

提交回复
热议问题