I am probably using custom actions incorrectly. I want to have
several different versions of "show" action where the sub-data is
gathered with some specific parameters (effectively filtering the
data).
So basically I might have on a page:
XXX Errors: 43 -> which links to a show action of xxxerrors
ZZZ Errors: 8 -> which links to a show action of zzzerrors
These methods are called, the error data is loaded but then when it
routes to show the page it overrides my error collection and uses the
default query for show (I can see it requery in the log)! I don't
want it to do that. Is there a better approach? I am doing this
through a parent class page and the show method is for said parent
that "has_many" errors.
Here is an example of a method in the controller (ThisClassController,
let's call it):
show_action :xxxerrors do
@this_class = ThisClass.find(params[:id])
sql = "blah blah blah"
@error_logs = ErrorLog.find_by_sql(sql)
end
I see this method working and returning the correct data... then when
it moves to render, the default "show" action does its own querying
and overwrites my @error_logs.
Also, is the "this_class" redundant? Would I already have it
available in my scope?
Thank you, in advance.
--
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.