After following a helpful tutorial by Ryan Bates, I realized that the final output was just a bunch of objects rather than their values. The tutorial can be found here.
In my database, I have a model called User with attributes name (string) and value (integer).
Instead of seeing [object Object],[object Object],[object Object],[object Object],[object Object], I would like the alert javascript function to display all the names and values from the database.
class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
gon.users = User.all
end
end
This is how my users controller looks:
alert gon.users if gon