Displaying 1 result from an estimated 1 matches for "fermscontroller".
2008 Apr 02
9
Problem getting the most recent has_many associated object
...my app:
I have two models, Ferms and Kinetics. Ferm has_many :kinetics,
Kinetic belongs_to :ferm. Kinetic has the fields ferm_id, brix and
temp.
In my ferms/index view I have a table listing the attributes of each
ferm instance. I would like to display the most recent kinetic for
each ferm...
My FermsController includes
def index
@ferms = Ferm.find(:all, :include => :kinetics)
...
end
I can see the associated kinetics in the view with <%= debug(@ferms)
%>... and I''ve hit a wall trying to get the most recently added
kinetic into the view. Any help is greatly appreciated,
SH
--~--~-...