📜  rails to json - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:40.459000             🧑  作者: Mango

代码示例1
// Used in Rails 6
// Inside your template you can have a Model converted in Json (Javascript) 
// adding:

const JavascriptVariable = <%=raw @model.to_json() %>;