user5496955
user5496955

Reputation:

How to integrate charts in Active Admin

I want to show graph and charts in my app. For this I use charts in rails.

http://railscasts.com/episodes/223-charts

It works fine.I want to know is it possible I integrate it with active admin in rails?

Till now I can't done anything on its integration because I have no understanding how to start

Upvotes: 1

Views: 2088

Answers (1)

Adib Saad
Adib Saad

Reputation: 572

You can render a partial in show or index page, as shown here.

ActiveAdmin.register Post do
  show do
    # renders app/views/admin/posts/_some_partial.html.erb
    render 'some_partial', { post: post }
  end
end

The partial can be plain old html/erb so you can include a <script> section with the necessary javascript to render your chart.

Upvotes: 1

Related Questions