Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 show.html.haml 文件,它在我的控制器中调用 display.js 我有一个变量 @category
我将如何在视图使用的 display.js 文件中使用@category?
谢谢!
好吧,我想我只需要休息一下;这里:
= javascript_tag do var category = '#{@category}' = javascript_include_tag "your_javascripts.js"