Try if="&@user.administrator" or if="#[email protected]}"
You want to tell Hobo that the part inside the quotes is ruby code. Both mechanisms do this. Now there are some attributes where only ruby code makes sense, so the & can be omitted, but that often gives slightly different results. In this case, Hobo is assuming that you are providing a method name instead. So if="administrator" should also work for you. if="&this.administrator" would be more idiomatic Hobo than if="&@user.administrator", although they would both work. The former is code that could be reused on other types of objects -- the latter only would work on User's. cheers, Bryan On Jun 15, 5:26 pm, hobo_hippy <[email protected]> wrote: > I'm modifying a card; > > <def tag="card" for="User"> > <card class="user" param="default" merge> > <header: param> > <h4 param="heading"><a><name/></a></h4> > <a action="new" if="@user.administrator==true" to="&model" > param="new-link"/> > </header:> > </card> > </def> > > I'd like the if statement to only let the button be visible if the > user is the administrator: > > <a action="new" if="@user.administrator==true" to="&model" param="new- > link"/> > > i also tried > > <a action="new" if="@user.administrator" to="&model" param="new-link"/ > > > > since user.administrator is a boolean anyway. Either way, I get: > > compile error > app/views/taglibs/application.dryml:20: syntax error > output_buffer.concat " "; concat((if ! > ([email protected]==true).blank?; (__tmp_1 = call_tag_parameter > (:a, {:action => "new", :to => (model)}, {}, > all_parameters, :new_link); Hobo::Dryml.last_if = true; __tmp_1) else > (Hobo::Dryml.last_if = false; ''); end)) ; output_buffer.concat "\n" > > I suppose I'm still unfamiliar with the data nomenclature. I'm sure > this is a quick fix so if anyone could shout out some help, I'd > appreciate it. > > THANKS! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
