Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you assign variables to gon in a view #220

Open
cmendla opened this issue Mar 6, 2017 · 1 comment
Open

How do you assign variables to gon in a view #220

cmendla opened this issue Mar 6, 2017 · 1 comment

Comments

@cmendla
Copy link

cmendla commented Mar 6, 2017

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

@p12y
Copy link

p12y commented Mar 19, 2017

If I remember correctly, you can use global variables for this. For example, Gon.global.variable = '1234'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants