I have a view file .html.erb with a script somewhere in the file:
<script>
console.log("event snippet sent to analytics...");
</script>
And I want to load the script just the first time the user enters this view, I'm new in ruby so if I need a controller how should be or how do I declare it in the view?