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

  • SEARCH
  • Home
  • 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 6345483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:49:55+00:00 2026-05-24T20:49:55+00:00

I am trying to implement lazy high charts using the following github site GitHub

  • 0

I am trying to implement lazy high charts using the following github site GitHub I have done the following steps

  • rails plugin install git://github.com/michelson/lazy_high_charts.git

  • @h = LazyHighCharts::HighChart.new(‘graph’) do |f|
    f.series(:name=>’John’, :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
    f.series(:name=>’Jane’, :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
    end

  • <%= javascript_include_tag ‘highcharts’ %>
  • <%= high_chart(“my_id”, @h) %>

What is confusing is I reach the point where it tells you to put the code into the controller but doesn’t tell you where exactly. So I tried doing some of the following and these were the results

1)

class DashboardController < ApplicationController
   access_control do
    actions :index do
      allow :Admin
    end
  end

 def index
   @title = "Welcome to Dashboard"
    before_filter :authenticate, :only => [:index]
  @h = LazyHighCharts::HighChart.new('graph') do |f|
    f.series(:name=>'John', :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
    f.series(:name=>'Jane', :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
        end
     end
    end

Outcome =

Routing Error

uninitialized constant DashboardController::LazyHighCharts

2)

 class DashboardController::LazyHighCharts < ApplicationController
  before_filter :authenticate, :only => [:index]
  @h = LazyHighCharts::HighChart.new('graph') do |f|
    f.series(:name=>'John', :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
    f.series(:name=>'Jane', :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
  end
   access_control do
    actions :index do
      allow :Admin
    end
  end

  def index
   @title = "Welcome to Dashboard"
  end
end

View

    <%= javascript_include_tag 'jquery.dataTables.min', 'datatable', 'jquery.dataTables.columnFilter'%>
    <%= stylesheet_link_tag 'demo_table', 'jquery-ui-1.8.4.custom' %> 
    <%= javascript_include_tag 'highcharts'
    <div class="head">
        <h1>Welcome to Dashboard</h1>
    </div>
    <div class="row">
    <div class="um rollover" id="um"><a><center><%= link_to image_tag("User.png", :alt => "User Management", :height => "100"), usermanagement_path %></center><br /><center>User Management</center><br /></a></div>
    <div class="pm rollover" id="pm"><a><center><%= link_to image_tag("Project.png", :alt => "Project Management", :height => "100"), projects_path %></center><br /><center>Project Management</center><br /></a></div>
    <div class="ts rollover" id="ts"><a><center><%= link_to image_tag("Timesheet.png", :alt => "Timesheets", :height => "100"), timesheet_path %></center><br /><center>Timesheets</center><br /></a></div>
    <div class="crm rollover" id="crm"><a><center><%= link_to image_tag("Customer.png", :alt => "Customer Relation Management", :height => "100"), crm_path %></center><br /><center>Customer Relation Management</center><br /></a></div>
    </div>

<%= high_chart("my_id", @h) %>

Outcome =

 LoadError in DashboardController#index

Expected c:/Users/patterd/documenTS/PadOnRails/app/controllers/dashboard_controller.rb to define DashboardController

I tried these both ways and recieved different errors. I am still new to ror and javascript, so this may seem fairly easy to the you. Is there any suggestion or any advice where I am going wrong.

  • 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-05-24T20:49:56+00:00Added an answer on May 24, 2026 at 8:49 pm

    Your main issue is this code block:

    @h = LazyHighCharts::HighChart.new('graph') do |f|
        f.series(:name=>'John', :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
        f.series(:name=>'Jane', :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
    end
    

    Should be inside a controller action.

    def index
      @h = LazyHighCharts::HighChart.new('graph') do |f|
        f.series(:name=>'John', :data=>[3, 20, 3, 5, 4, 10, 12 ,3, 5,6,7,7,80,9,9])
        f.series(:name=>'Jane', :data=> [1, 3, 4, 3, 3, 5, 4,-46,7,8,8,9,9,0,0,9] )
      end
    end
    

    Also I’d recommend installing it by adding the gem to your Gemfile instead of the plugin installation method.

    gem 'lazy_high_charts'
    

    Install gems:

    bundle install
    

    Install highcharts:

    rails g lazy_high_charts:install
    

    Don’t forget this gem also requires jquery, so add the following to your gemfile:

    gem 'jquery-rails'
    

    Then install:

    bundle
    

    Then create the javascript:

    rails g jquery:install
    

    I have created a sample app, you can see it here: https://github.com/Gazler/Highcharts-rails-example

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

Sidebar

Related Questions

trying to implement a dialog-box style behaviour using a separate div section with all
I have a problem when trying to update foreign keys. Using the merge function
I'm trying to implement a lazy sequence (meaning that the next item is only
Trying to implement a timer for my game that I'm making. I have a
Trying to implement a simple print in SL4. I have a DataGrid that I
trying to implement a multiplayer. Using the sample from Game Center - Sending and
I trying to implement the url template tag into my project. I have a
I am trying to implement lazy partitioning of an iterator object that yields slices
So I am trying to implement a basic image lazy load feature to speed
I'm trying to be lazy and implement the cast operators in the abstract base

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.