List of models in Hobo

15 views
Skip to first unread message

Luke

unread,
Nov 15, 2011, 3:28:14 PM11/15/11
to Hobo Users
Hi guys - first of all fantastic work with Hobo. I'm glad to be doing
web dev again in a world where things have come along this far.

I have a project where LifeCycles will be really useful. A user can
add a bunch of different LifeCycle based models to a list and then
manipulate them individually.

My question is what's the best pattern for doing this with Hobo?

Perhaps the fact that I'm using LifeCycles is really a red herring - I
guess the real question is what is the best way with Hobo for a user
to have a list of instances of different classes/models?

Sorry if my explanation is poor - it's been a while since I've been in
the Ruby world so my language is still getting back up to speed

TIA

Luke Reid

Ankur

unread,
Nov 15, 2011, 4:23:54 PM11/15/11
to Hobo Users
Do you want to list the instances of a class or the classes?

kevinpfromnm

unread,
Nov 15, 2011, 4:25:13 PM11/15/11
to hobo...@googlegroups.com
So you have a bunch of model instances from different types and want to display them?

Assuming this is mostly about the view side, there's a simple approach of putting them all in an array and setting that array as the context for a <collection> tag.  Hobo will handle using the appropriate card based off the class of each instance.  Cards can be customized on a per class basis in your taglib definition(s).

<extend tag="card" for="ModelName">
  ...

Luke Reid

unread,
Nov 15, 2011, 4:34:57 PM11/15/11
to hobo...@googlegroups.com
Nice - I'll try this approach.

Thanks for the help, I don't think I would have found this by myself

Luke

> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/kK3e1DIq96cJ.
> To post to this group, send email to hobo...@googlegroups.com.
> To unsubscribe from this group, send email to
> hobousers+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
>

kevinpfromnm

unread,
Nov 15, 2011, 5:26:38 PM11/15/11
to hobo...@googlegroups.com, lu...@reid.org.nz
I can't recall if there's something in the book about using polymorphic tags for collections or not.  I might've hinted at it in the tutorial I wrote.

Owen Dall

unread,
Nov 15, 2011, 5:30:34 PM11/15/11
to hobo...@googlegroups.com
That would be a good addition...

On Tue, Nov 15, 2011 at 5:26 PM, kevinpfromnm <kevinp...@gmail.com> wrote:
I can't recall if there's something in the book about using polymorphic tags for collections or not.  I might've hinted at it in the tutorial I wrote.

--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hobousers/-/cGpccAkcoLoJ.

To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.



--
Owen Dall, Chief Systems Architect
Barquin International
Reply all
Reply to author
Forward
0 new messages