Have you tried using this_parent.showspecialcontrols? On Sunday, January 12, 2014 8:32:10 AM UTC-7, Tim Griffin wrote: > > Hi all, > > This may seem really basic, but it tripped me up for a while because I'd > forgotten a basic Hobo tenet: *Always be aware of context*. > > I'd defined a tag that calls another custom tag as follows: > > <def tag="plans" attrs="showspecialcontrols"> > <my-table-plus:plans fields="plan_no, plan_type" showmycontrols=" > &showspecialcontrols"> > ... > </def> > > > But, for the longest time, the highlighted attribute call generated: > > undefined method `showspecialcontrols' for #<#<Class:... > > It took me a while to realize/remember that by including "plans" in my > call to <my-table-plus:> I'd shifted the context for the attribute I'd > passed in. Hobo was now looking for a *showspecialcontrols* method on a > plan, which didn't exist. > > Unless someone can contribute an alternate solution, I couldn't see a way > around this without assigning the *showspecialcontrols* attribute to an > instance variable: > > <def tag="plans" attrs="showspecialcontrols"> > > <!-- We need an instance variable here otherwise context is confused > within call to my-table-plus --> > <% @show = showspecialcontrols %> > > <my-table-plus:plans fields="..." showmycontrols="&@show"> > > > Tim > > > > > >
-- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/hobousers. For more options, visit https://groups.google.com/groups/opt_out.
