I'm new to rails and am trying to get an understanding on some of the
language usage...I have a mysql database with a table of data...I want
to retrieve the last record in that table without sending it an 'id'
or anything...I've tried the following:
@prevticket = Tankticket.find(:last)
last_net_vol = @prevticket.net_vol
This fails with:
Couldn't find Tankticket with ID=last
Extracted source (around line #54):
51: <p>VCF = <%= ctl -%></p>
52: <p>Net Vol = <%= round((grs_vol * ctl + roof_cor), 2) -%></p>
54: <p>Last Net Vol = <%= get_last_net_vol -%></p>
Everything I've read tells me this should have worked so I'm
suspicious that it might be the version of rails I'm running...!
I'm running an old dual proc mac G4 with os x 10.5.8...ruby version
1.8.6...gem version 1.0.1...rails version 1.2.6
I know I should update to the later version of rails and gem…I have
tried but the standard methods to do so fail with
(Gem:RemoteSourceException) HTTP Response 301 fetching
http://gems.rubyforge.org/yaml)…I guess I could install it the hard
way but I don't want to chance compromising my current running
Any light shed will be greatly appreciated...!