Questions tagged [gon]
25 questions
0
votes
0 answers
Uncaught TypeError: $.ajax is not a function when trying to use gon.watch in cytoscape
This is my code. It's part the configuration of a library for context menus, and get's triggered if I click on an item in the context menu. Then I see the error mentioned in the title.
{
[...]
onClickFunction: function (event){
[...]
…

troricleba
- 151
- 1
- 3
- 12
0
votes
1 answer
How to get information from a checkbox back into the DB in Ruby
I'm pretty sure I'm being an idiot here, but I've been out of Ruby long enough that my searching isn't coming up with the right answer.
I have a popup with a checkbox. I want, if the user checks the checkbox, to set a flag in the Users table so that…

Brian Postow
- 11,709
- 17
- 81
- 125
0
votes
1 answer
Rails 4 - Remove attributes from an already filtered Active Record query
In one of my ruby on Rails 4 controller, I have a method that injects data necessary to a View.
The data needed vary between the data needed by the html and the data needed by the javascript. I am using gon to inject the data into the js scripts.
My…

Mathieu
- 4,587
- 11
- 57
- 112
0
votes
2 answers
Accessing gon variable that references form params
I'm trying to build a simple page that searches for github users and displays their followers on the page without refreshing the page. I'm using Octokit to access the Github api and Gon to create controller variables that can be accessed in js.erb…

Brett
- 49
- 2
- 8
0
votes
2 answers
Why is this controller variable not getting through to this javascript code?
I am trying now to use my javascript to render a new view on click of an element, with this code;
$(document).ready(function() {
$('.link-panel').click( function() {
window.location.replace('/quotes/'+gon.gon_quote_id);
});
});
and…

jbk
- 1,911
- 19
- 36
0
votes
2 answers
Rails, Gon - You can't use Gon public methods for storing data
I have following error when try login in app:
You can't use Gon public methods for storing data
Pointed to this code:
gon.current_user = { sn: current_user.sn }
Can you help me what is wrong with this code?
I am using version 5.2.3 of Gon.

Maximi
- 559
- 5
- 18
0
votes
0 answers
How to load helpers before JS source files in Jasmine
This question is specifically because I'm using gon, but conceptually it could apply to other cases, so I've tried to broaden it a bit. Gon is a nifty gem that allows you to declare a variable in your Rails controller and then use it in your…

james
- 3,989
- 8
- 47
- 102
0
votes
1 answer
pass variables to javascript rails
Using the rails cast http://railscasts.com/episodes/324-passing-data-to-javascript?autoplay=true
to pass a variable from my controller to javascript.
I have a button, when I click on it, i want it to show the number of upvotes.
Im using gon.
When I…

mogoli
- 2,153
- 6
- 26
- 41
0
votes
1 answer
Regex help to get a variable value from Javascript block
I have a JavaScript block from where I need to extract a value. it look something like this:
I need to get value for…

Mukul Chaudhary
- 5
- 5
0
votes
1 answer
Making Rails javascript code DRY
I have two files that use some common javascript code and the rails gon gem.
So for file 1: file1.js looks like this
$(function () {
function a() {
....
}
$('id').on('click', function() {
c = gon.obj1
c.doSomething
....…

gazubi
- 561
- 8
- 32