On Fri, Aug 28, 2009 at 2:29 AM, Matt Jones <[email protected]> wrote:

>
> Your best bet is to set up the Episode card like usual:
>
> <def tag="card" for="Episode">
> ..etc..
> </def>
>
> Then PlaylistEpisode (which I'm assuming has_one or belongs_to Episode)
>
> <def tag="card" for="PlaylistEpisode">
>    <card:episode merge>
>     ...do some stuff here...
>   </card>
> </def>
>

Yeah, that should work.  I'll give it a shot.  Thanks Matt!


The cookbook section on polymorphic tags is pretty handy here too.
>

True, but I wonder if there's a little undocumented behavior here?  Here's
part of the polymorphic section:

<def tag="card" for="Product">
  <card merge>
    <heading: param><a href="#{object_url this}"><%= h this.to_s
%></a></heading:>
    <body: param="price">$<%= this.price %></body:>
  </card>
</def>

We call this a type-specific definition. Some points to notice:

   - The callback to <card> is not a recursive loop, but a call to the base
   definition.

Why isn't the call to <card> a recursive loop?  If 'this' is set to a
Product, and I don't explicitly call the base card (for-type="&nil"?), then
I would expect <card> to invoke the Product card.

Is there a special case where, if you're calling a polymorphic tag from
within a polymorphic tag, the base tag automatically gets called?

    - Scott

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