我正在尝试在我的Sinatra应用程序中使用ChartKick 。尝试创建条形图等控件时,我收到一条错误消息
{:cash=>82, :securities=>58} 的未定义方法“id”:哈希文件:buffer.rb 位置:parse_object_ref 行:323
有关解决此问题的任何建议?
应用程序.rb
...
@estimates = {:cash => cash_estimate, :securities=> sec_estimate}
haml :results
...
结果.haml
%label="By saving cash you will be able to retire at the age of #{@estimates[:cash]}}."
%br
%label="Choosing to invest your savings in stock securities may allow you to retire at #{@estimates[:securities]}."
%barchart[@estimates]
%script{:type => 'text/javascript', :src => '//www.google.com/jsapi'}
%script{:type => 'text/javascript', :src => '/js/chartkick.js'}