tag <editor/>

24 views
Skip to first unread message

Javier V

unread,
Apr 25, 2013, 1:31:31 PM4/25/13
to hobo...@googlegroups.com
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?

kevinpfromnm

unread,
Apr 25, 2013, 4:48:23 PM4/25/13
to hobo...@googlegroups.com
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.

Ignacio Huerta

unread,
Apr 27, 2013, 5:58:16 AM4/27/13
to hobo...@googlegroups.com, kevinpfromnm
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�:
> --
> 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 hobousers+...@googlegroups.com.
> To post to this group, send email to hobo...@googlegroups.com.
> 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

Javier V

unread,
May 8, 2013, 1:18:10 PM5/8/13
to hobo...@googlegroups.com
Great, thank you for your help. It works.
Regards

Javier V

unread,
May 8, 2013, 1:19:50 PM5/8/13
to hobo...@googlegroups.com, kevinpfromnm
Thank you Ignacio, Regards


El sábado, 27 de abril de 2013 02:58:16 UTC-7, Ignacio Huerta escribió:
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�:
Tel�fono: 0034 645 70 77 35

Quiliro Ordóñez

unread,
May 18, 2013, 5:53:00 PM5/18/13
to hobo...@googlegroups.com
El 25/04/13 12:31, Javier V escribi�:
> <field-list fields="field8,field9field7,field4,attachment"/>

A coma is missing on this line. ^

--
Saludos libres,

Quiliro Ord��ez
Presidente (en conjunto con el resto de socios)
Asociaci�n de Software Libre del Ecuador - ASLE
Av de la Prensa N58-219 y Crist�bal Vaca de Castro
Quito, Ecuador
(02)-600 8579
IRC: http://webchat.freenode.net?channels=asle&uio=OT10cnVlJjEwPXRydWU3a

Todo correo que reciba ser� tratado como informaci�n p�blica, de libre copia y modificaci�n, sin importar cualquier nota de confidencialidad.

Reply all
Reply to author
Forward
0 new messages