Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:48:26+00:00 2026-06-09T01:48:26+00:00

hello I have been reading about how to make graphs using google-charts-on-rails, I already

  • 0

hello I have been reading about how to make graphs using google-charts-on-rails, I already installed the plugin but I don`t know why shows me this error:

NameError in TankingLogsController#index

uninitialized constant TankingLogsController::GoogleChart

this is my indes.html.erb

<div class="container">
 <%= image_tag @bar %>

  <h1>Listing Tankings</h1>
  <% if @tankinglog.count<1 %>
    <p>
    There are no tankings for this car. Do you want to <%= link_to 'create a new tanking', new_user_car_tanking_log_path(@user, @car)%>
    </p>
  <% else %>
    <table class="table table-condensed">
      <tr>
        <th>Cost</th>
        <th>Gallon</th>
        <th>Km</th>
        <th>Date</th>
        <th>Gas Station's id</th>
        <th></th>
      </tr>
      <% @tankinglog.each do |tankinglog| %>
        <tr>
          <td><%= tankinglog.cost %></td>
          <td><%= tankinglog.gallon %></td>
          <td><%= tankinglog.km %></td>
          <td><%= tankinglog.date %></td>
          <td><%= tankinglog.gas_station_id %></td>
        </tr>
      <% end %>
    </table>
    <br />
    <%= link_to 'New tanking', new_user_car_tanking_log_path(@user, @car), :class => "btn btn-primary" %>
  <% end %>
  <br />
  <br />
  <%= link_to 'back', user_cars_path(current_user), :class => "btn btn-primary" %>
  </div> 

here is my controller

class TankingLogsController < ApplicationController

....


  def index
    @user = User.find(params[:user_id]) 
    @car = @user.cars.find(params[:car_id])    
    @tankinglog = @car.tanking_logs.all
    @bar = GoogleChart.pie(['1997',10],['1998',20],['1999',40],['2000',30]).to_url
  end
end

my Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.6'
gem 'pg', '0.13.2'
gem 'devise', '2.0.4'
gem 'haml-rails'
gem 'twitter-bootstrap-rails', '2.0.6'
gem 'sass-rails',   '~> 3.2.3'
gem "rspec", "~> 2.10.0"
gem 'simplecov', :require => false, :group => :test
gem 'gchart'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:48:27+00:00Added an answer on June 9, 2026 at 1:48 am

    You should make sure the gem is in your Gemfile:

    gem 'google-charts-on-rails'
    

    Otherwise the app will not use the gem, even if you have it installed on your system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello im new to python and have been reading over the documentation and am
Hello guys, I have been trying to implement the DSUM function but failed to
Hello I have been trying to format this date but it keeps giving me
I've been reading about autoreleasepool but there is a point which is a bit
Hello I am trying to read my xml document using xpath. I have been
Hello I have been using JQuery for quite a while. I need to get
I've been doing some reading into designing template code have a question about it.
Hello my StackOverflow friends. I have been doing wxPython tutorials and reading the documentation,
I have been reading Google's android tutorial and I got a problem... In the
Hello I have been having trouble with this for a while now. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.