Try this:
<extend tag="form" for="Person">
<old-form merge>
<field-list: fields="last_name, first_name, address1, city">
<city-view:>
<name-one/>
</city-view:>
</field-list:>
<submit: label="Enregistrer"/>
</old-form>
</extend>
Bryan
François Beausoleil wrote:
> Hey Tom, thanks for the tip. That works for this specific case, but
> what about the general case? Replacing a field, or reordering while
> adding more fields? Inserting fields really is what I'm after.
>
> Here's my Person model:
>
> class Person < AR::B
> fields do
> last_name :string
> first_name :string
> address1 :string
> email :string
> # among others
> end
>
> belongs_to :city
> end
>
> The default form puts City at the bottom, but I want it in the middle,
> after address1. I know about <field-list: fields="last_name,
> first_name, address1, city"/>, which is what I've used. But now I
> wanted to move city AND change it's type. Let's say I want a name-one
> on a single field, rather than everywhere? How do I do that?
>
> If it's already written, could you point me in the right direction? I
> did follow the Agility tutorial, which was an eye opener. The docs
> are fine, but the tutorial gave me the best info for what I'm ready/
> needing at the moment.
>
> Thanks all!
> François
>
> On 7 déc, 12:14, Tom Locke <[email protected]> wrote:
>> Note that if you want to always use <name-one> instead of <select-one> for
>> any belongs_to :city, you can just add this to application.dryml.
>>
>> <def tag="input" for="City"><name-one merge/></def>
>>
>> Tom
>>
>> On 7 Dec 2009, at 17:08, François Beausoleil wrote:
>>
>>
>>
>>> Hi all,
>>> I'm just starting out with Hobo. I love the extensions to
>>> ActiveRecord, but I'm struggling with DRYML. I can't even replace a
>>> select-one on a form with a name-one. Here's what I have:
>>> # app/views/taglibs/application.dryml
>>> <extend tag="form" for="Person">
>>> <old-form merge>
>>> <field-list:>
>>> <input:last-name/>
>>> <name-one:city/>
>>> </field-list:>
>>> <submit: label="Enregistrer"/>
>>> </old-form>
>>> </extend>
>>> # app/views/people/new.dryml
>>> <new-page>
>>> <title:>Ajout d'une personne</title:>
>>> <heading:>Ajout d'une personne</heading:>
>>> </new-page>
>>> On my person/new page, I do see the French title + heading, but the
>>> form stays the same, unless I use the <field-list: fields="last_name,
>>> first_name, ..."/> form. But then, I don't get the name-one for my
>>> city (which is part of a belongs_to relationship).
>>> I'm trying to follow the cookbook
>>> onhttp://cookbook.hobocentral.net/recipes/36-using-a-name-one-one-a.
>>> What am I doing wrong? I read the <form> source code, but I can't
>>> even find a reference to field-list as a parameter.
>>> I tried searching this group too:
>>> http://groups.google.com/group/hobousers/search?group=hobousers&q=rep...
>>> Thanks!
>>> François
>>> --
>>> 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
>>> athttp://groups.google.com/group/hobousers?hl=en.
>
> --
>
> 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.
>
>
>
--
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.