I've noticed this before, that 'this' doesn't seem to get updated
until fully inside the tag though it seems like it'd make more sense
to have it apply in the tag that changes context.  From the example:

  <a:stories action="new" if="&can_create?" param="new-link">New
Story</a>
The context is being changed for use with the 'a' tag, though it
doesn't affect the if statement, but does affect what is being
linked.  It's somewhat inconsistent there.  What I ended up doing was
something like:
  <do with="stories"><a action="new" if="&can_create?" param="new-
link">New
Story</a></do>
(Not my actual code which I don't recall, was something with table-
plus or a form) and that would work since the 'this' context has been
set before entering the tag.

I haven't looked at how tags actually get processed so this may be
problematic for other reasons.
Kevin

On Sep 4, 2:36 pm, Matt Jones <[EMAIL PROTECTED]> wrote:
> The call to can_create needs to be passed the collection  
> (@project.stories, in this case)
> rather than the default of "this" (the project). I've pushed a fix to  
> github.
> (one line in pages.dryml.erb).
>
> --Matt
>
> On Sep 4, 2008, at 2:00 PM, kevinpfromnm wrote:
>
>
>
> > The :stories in the beginning changes the context.  But the & might be
> > dropping the context.  I haven't looked deeper into the methods so
> > can't comment about whether can_create? can be explicitly called from
> > 'this' or use 'this' as a parameter to it.
>
> > On Sep 4, 11:40 am, stissing <[EMAIL PROTECTED]> wrote:
> >> Hi there. I just downloaded 0.8. I'm extremely impressed with it.  
> >> Nice
> >> work.
>
> >> I started doing the agility-tutorial until a small problem occurred.
> >> It seems that when the generated show-page for Project "decides"
> >> whether or not to render a "New Story" link, the object passed to
> >> can_create? is the project instead of the new story.
>
> >> pages.dryml - not working:
>
> >>   <a:stories action="new" if="&can_create?" param="new-link">New
> >> Story</a>
>
> >> pages.dryml - working (for me at least):
>
> >>   <a:stories action="new" param="new-link">New Story</a>
>
> >> I'm not fluent in DRYML yet, so i'm not completely sure how the
> >> <a:stories ... is supposed to change the context. Has anyone
> >> experienced something similar to this?
--~--~---------~--~----~------------~-------~--~----~
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