View Single Post
Old Jun 1st, 2006, 4:53 PM   #7
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
You should be able to replace lines like this:
@oil = Oil.find(:all, :conditions => ['vehicleID = ?', id])
With lines like this:
@truck = Truck.find(@params["id"]) 
@oil = @truck.oils
The has_many and belongs_to constructs should make the two pieces of code equivalent in function.
Arevos is offline   Reply With Quote