How to embed Ruby in JavaScript (Rails + .html.erb file)

后端 未结 4 962

I have a .html.erb file, with some javascript in it. I would like to do something like this:

var stuff = \'
<%= @ruby_var.title %>
\'
4条回答
  •  广开言路
    2021-02-05 07:33

    
    

    in your .html.erb file will work fine.

提交回复
热议问题