gon
gon copied to clipboard
How do you assign variables to gon in a view
I need to be able to assign/change gon variables in a view. I did find something about how to do that but couldn't find it again.
I tried
<%= @gon.namespace = {
:vartest => "1234"
}
%>
but that gave me an error of
NoMethodError in SlitterBedsheets#show
My goal is to assign a global variable from a view.
thanks
If I remember correctly, you can use global variables for this. For example, Gon.global.variable = '1234'.