In my controller, I have a model that preloads (or eager loads?) its
respective child members.
class Parent < ApplicationController
def show
@parent = Parent.find(:all, :include => :children)
end
end
In my view, I need to display a specific child by searching for it in
@parent.children. Right now I am using ActiveRecord's find, which
results in an additional query to the database.
In my controller, I have a model that preloads (or eager loads?) its
respective child members.
class Parent < ApplicationController
def show
@parent = Parent.find(:all, :include => :children)
end
end
In my view, I need to display a specific child by searching for it in
@parent.children. Right now I am using ActiveRecord's find, which
results in an additional query to the database.