View Single Post
Old Jun 1st, 2006, 5:06 PM   #6
SirBob1701
Newbie
 
Join Date: May 2006
Posts: 20
Rep Power: 0 SirBob1701 is on a distinguished road
I actually broke it down like this and it works well.
    def found
         
          @truck = Truck.find(@params["id"]) 
          find_others(@truck.vehicleID)
        end
        def find_others(id)
          
          @oil = Oil.find(:all, :conditions => ['vehicleID = ?', id])   
          @apperance = Apperance.find(:all, :conditions => ['vehicleID = ?', id])
          @brake = Brake.find(:all, :conditions => ['vehicleID = ?', id])
          @inspection = Inspection.find(:all, :conditions => ['vehicleID = ?', id])
          @rdifferential = Rdifferential.find(:all, :conditions => ['vehicleID = ?', id])
          @tow = Tow.find(:all, :conditions => ['vehicleID = ?', id])
          @tred = Tred.find(:all, :conditions => ['vehicleID = ?', id])
          @repair = Repair.find(:all, :conditions => ['vehicleID = ?', id])
    end

I'm still running into errors though trying to write the primary key manually. Gonna have to look into that.
SirBob1701 is offline   Reply With Quote