j_McCaffrey
unread,Nov 9, 2011, 6:39:27 PM11/9/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hobo Users
I would like do remove the ability to edit the last_login_at from the
user form, as its not something you should edit. (I want to display
it, but just not edit it).
Is there a way to make this not editable in the form? (something at
the model level?)
There is an existing user form in forms.dryml
<def tag="form" for="User">
<form merge param="default">
<error-messages param/>
<field-list fields="first_name, last_name, company_name, title,
last_login_at, company_phone_number, email_address, role, state,
organization" param/>
<div param="actions">
<submit label="#{ht 'user.actions.save', :default=>['Save']}"
param/><or-cancel param="cancel"/>
</div>
</form>
</def>
In general I try not to completely override the defaults, I just merge
in my changes, so that if I add new columns, they will automatically
show up where they should.
I would like to do something like this in my application.dryml
<extend tag="form" for="User">
<old-form merge>
<field-list merge skip="last_login_at" />
</old-form>
</extend>
This kind of works, in that it hides the last_login_at (if I could
display it as non-editable that would be the best), but it also loses
the error-messages and submit buttons section.
How do I replace just parts of a defined tag, but not those elements
around it?
I feel like if I understand how to do this, it will go a long way in
helping me master Hobo. (I have wasted a lot of time screwing around
with dryml stuff so far)
Thanks for your help!