Reputation: 1233
i have a show.html.haml file that calls a display.js in my controller I have a variable @category
how would I use @category in my display.js file that's being used by view?
Thank you!
Upvotes: 1
Views: 247
Reputation: 1233
Well I guess I just needed to take a short break; here:
= javascript_tag do
var category = '#{@category}'
= javascript_include_tag "your_javascripts.js"
Upvotes: 2