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

URLs as data don't work #14

Closed
krainboltgreene opened this issue May 22, 2013 · 3 comments
Closed

URLs as data don't work #14

krainboltgreene opened this issue May 22, 2013 · 3 comments

Comments

@krainboltgreene
Copy link

<%= line_chart [
   { name: "Total", data: statistics_path(key: "persons", subkey: "total") }
] 
%>

Produces a chart, but never hits the url.

@ankane
Copy link
Owner

ankane commented May 23, 2013

To keep things simple, AJAX requests only work with:

<%= line_chart statistics_path(key: "persons", subkey: "total") %>

The endpoint can return:

render json: {name: "Total", data: chart_data}

This equates to 1 AJAX requests per chart. Otherwise, for multiple series, there could be multiple AJAX requests, which (IMHO) adds unnecessary complexity.

@krainboltgreene
Copy link
Author

Very true, I'm happy with this.

On Thu, May 23, 2013 at 12:40 AM, Andrew Kane notifications@github.comwrote:

To keep things simple, AJAX requests only work with:

<%= line_chart statistics_path(key: "persons", subkey: "total") %>

The endpoint can return:

render json: {name: "Total", data: chart_data}

This equates to 1 AJAX requests per chart. Otherwise, for multiple series,
there could be multiple AJAX requests, which (IMHO) adds unnecessary
complexity.


Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-18328005
.

Kurtis Rainbolt-Greene, Hacker
Software Developer
612 S. Flower St.
Los Angeles, CA, 90017

@ankane
Copy link
Owner

ankane commented May 23, 2013

Cool.

@ankane ankane closed this as completed May 23, 2013
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants