On Mon, Aug 9, 2010 at 10:46 AM, Henry Baragar
<[email protected]> wrote:
> Hello,
>
> I have a few questions about hobo_index_for and auto_actions_for:
>
> How do you apply a scope to hobo_index_for? Specifically, how can I apply
> the search criteria?

hobo_index_for takes a :scope parameter, which actually supports
passing an arbitrary number of scopes with arguments. It works a lot
like apply_scopes does.

:scope => [[:foo], [:bar, :arg1, :arg2], [:baz, :arg3]]

will wind up effectively working like:

ParentModel.find(params[:parent_id]).association.foo.bar(:arg1,
:arg2).baz(:arg3).paginate

This was added very late in the 1.0 process, so probably needs better
documentation. It's also very hard to make it work if any of the
scopes need to depend on the parent object.

> I have two interesting index pages: index and index_with_conflicts. How can
> I create an auto_actions_for using index_with_conflicts?

This is the one thing that was missing; there *should* be something
like index_action_for or equivalent, but there isn't at present.
You'll probably wind up having to add the route explicitly.

> Why does the new-link on the index_for_owner page not preset the owner field
> (and possibly hide it)?

This is a bug; it was reported a while back and I just tripped over it
myself last week. Check lighthouse for some notes.

Thanks,

--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.

Reply via email to