On Aug 26, 2011, at 2:11 AM, Ignacio Huerta wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Jim,
> 
> First question is very interesting: parameter tags + ifs are not very
> good friends. There must be certainly a better way to do it, but this is
> the workaround I usually use in show.dryml:
> 
> <%
> custom_list = "client, location, ..."
> custom_list += ", status" if @record.status == 'draft'
> %>
> 
> <show-page>
>  <field-list fields="&custom_list"/>
> </show-page>


One helpful option here is the 'skip' option to field-list:

<show-page>
  <field-list: skip="#{'status' if this.published_state?}" />
</show-page>

@Jim: regarding the nil values post-migration, did the generated migration get 
the correct default? The code is designed to pass the state name marked with 
:default => true to the field declaration for :state_field, so it *should* have 
generated a correct default value for that database column...

--Matt Jones

-- 
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