On Feb 11, 2010, at 7:17 AM, Patrick Fitzgerald wrote:
Hi All,
Confused at the moment. I am using the standard Hobo output to
display results. The model: capture_profile has many children
pcap_sessions. In one case there are 800+ children. These are all
being displayed on the page. Each card only shows two lines. This
is having a performance impact. I have optimized the database queries
using eager loading to avoid the N+1 issue. Here's a sample of the
output in the log:
The cheap + cheerful way to deal with this would be to move your
action from CaptureProfilesController#show to
PcapSessionsController#index_for_capture_profile, thus:
def PcapSessionsController < ApplicationController
hobo_model_controller
auto_actions_for :capture_profile, :index
end
Then the CaptureProfile instance will be in @capture_profile for the
view, and you'll get pagination, etc. behavior for the PcapSessions
like you'd expect.
REST purists may be slightly horrified at this, but it does make life
easier...
--Matt Jones
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.