Hi everybody.
I am really struggling here.please help.
I created hash values in controller and want to send to the view.
I tested out the values in the controller, the values printed out
successfully in my log file
But then when i passed it to view, it printed out nil or no values.
Ive tried using array, same result.
Did i miss something. Please help.
Here 's my controller
##############################controller#################################
def stats
@cus_t = Hash.new
a = Gruff::Bar.new('500x350')
a.theme = {
:colors =>
['#138F6A','#330000','#0aaafd','#FF0000','#00CD00','#ff6602',
'#3bb003','#1e90af', '#efba30', '#0aaaac'],
:marker_color => '#aaa',
:background_colors => ['#eaeaea', '#fff']
}
a.hide_title = true
@customer = Customer.find(:all)
@customer.each do |custs|
@g_cus = Casedf.count(:all, :conditions=> "customer_id=" +
custs.id.to_s)
a.data(custs.companyname, @g_cus)
@cus_t[custs.companyname] = @g_cus
@cus_t.store(custs.companyname,@g_cus)
end
a.write("#{RAILS_ROOT}/public/images/customer.png")
$logger.info("hash keys #{@cus_t.keys}")
##############################end#########################################
##############################stats.rhtml#################################
…
No customer added so far<%=@cus_t.keys%> |
<%=@cus_t.keys%> |
it seems straight forward. but i might miss something or is it a bug?