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

Problem with urls as data #389

Closed
Raycoms opened this issue Oct 26, 2017 · 1 comment
Closed

Problem with urls as data #389

Raycoms opened this issue Oct 26, 2017 · 1 comment

Comments

@Raycoms
Copy link

Raycoms commented Oct 26, 2017

I tried to add the data as in #14 as a URL and found out that that doesn't work.

In order to solve that I followed the instruction of #14:

def limit_graph render json: {name: "Avail. Votes", data: User.calculate_seller_points.each} end

area_chart limit_graph_path

Which resulted in two graphs without any data, one for name and one for data.

The simple way:

`render json: User.calculate_seller_points.each`

Things work perfectly fine, but I'd like to name that data.

@ankane
Copy link
Owner

ankane commented Oct 27, 2017

Hey @Raycoms, try returning an array of hashes.

render json: [{name: "Avail. Votes", data: User.calculate_seller_points.each}]

@ankane ankane closed this as completed Nov 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants