I think kevin's approach is the best. Another option more similar to what you wrote:

<show-page>
  <field-list: replace>
    <% if units == "metric" %>
      <field-list fields="field1,field2,field3,field4,attachment">
        <field4-view:><editor/></field4-view>
      </field-list>
    <% else %>
      <field-list fields="field8,field9field7,field4,attachment">
        <field4-view:><editor/></field4-view>
      </field-list>
    <% end %>
  </field-list:>
  <collection: replace>
<embed src="/#{this.attachment}" width="100%" height="300" controller="true" autostart="false"></embed> <a href="/#{this.attachment}">Click here to see this video on a player</a><br/>
  </collection:>
</show-page>

Regards,
Ignacio

El 25/04/13 22:48, kevinpfromnm escribió:
When you call replace, you're literally replacing the tag.  Thus,
there's no more parameters available for one, and two, you can't mix
parameters and non-parameters in a single call anyway.

You might not need such a drastic approach anyway, try:

<field-list: fields="#{units == 'metric' ? 'field1,field2,field3' :
'field8,field9,field7'},field4,attachment" />

I'm not sure if you can use mix in a ruby call like that for fields or not.

On Thursday, April 25, 2013 11:31:31 AM UTC-6, Javier V wrote:

    Hello all.
    I have this code in my show.dryml and when I call the page I read
    the next error in log file.

    <show-page>
       <field-list: replace>
         <% if units == "metric" %>
           <field-list fields="field1,field2,field3,field4,attachment"/>
         <% else %>
           <field-list fields="field8,field9field7,field4,attachment"/>
         <% end %>
         <field4-view:><editor/></field4-view>
       </field-list:>
       <collection: replace>
         <embed src="/#{this.attachment}" width="100%" height="300"
    controller="true" autostart="false"></embed>
         <a href="/#{this.attachment}">Click here to see this video on a
    player</a><br/>
       </collection:>
    </show-page>

    The error is:
    ActionView::Template::Error (undefined method `field4_view' for
    #<#<Class:0x7fd7e2d5fe50>:0x7fd7e2d573e0>):

    This error is only when i use <% %> for the if but i dont know how
    to do it in a different way...

    Maybe is something silly...
    Can you help me please?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
Ignacio Huerta Arteche
http://www.ihuerta.net
Teléfono: 0034 645 70 77 35
Email realizado con software libre

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to