I want to include some Javascript functionality in a Haml view, but I don’t want it inserted into every view. Do I have to put the Javascript file in public/javascripts or can I put it in app/assets/javascripts to keep it hidden from user, and still reference from within the haml view file?
How would you do both these options if they are possible?
You should just use
if it’s specific to one place, you should use
content_forAnd then in your view