On Jan 18, 3:47 am, Matt Jones <[email protected]> wrote:
> On Jan 17, 2012, at 4:28 PM, JezC wrote:
...
> > Custom form modification was defined, though. I specified the fields I
> > wanted to show - but I didn't have the submit button. I thought I was
> > using a "form merge" to replace the fields, not the fields and the
> > submit button.
>
> > I think the real problem is that I put the form modification in
> > application.dryml - should I have put it in views/(model-name)/
> > form.dryml to make it more obvious for maintenance?
>
> It wouldn't get loaded from there, unfortunately, unless you included it 
> somehow. application.dryml is the typical place that such things go.
>
> There is one important gotcha to note, however, between a param tag and a 
> regular tag. For instance, this:
>
> <def tag="form" for="SomeModel">
>   <form merge>
>     <field-list fields="foo, bar, baz />
>   </form>
> </def>
>
> will produce a form with fields foo, bar and baz but without a submit button, 
> whereas this:
>
> <def tag="form" for="SomeModel">
>   <form merge>
>     <field-list: fields="foo, bar, baz />
>   </form>
> </def>
>
> will produce a form with fields foo, bar, and baz *and* the default submit 
> button. Note the : after field-list.
>
> In the first case, you're replacing the entire content of the form tag with 
> what you're passing. In the latter, you're passing the field-list parameter 
> to form leaving the remainder of the contents unchanged.
>
> --Matt Jones

Bingo. That was the missing bit. A single colon in the right place.

I guess I'll get used to looking in views/taglibs/application.dryml
when tracking down these sorts of problems. I was convinced, during
some of the debugging, that I'd not modified the form at all, because
there was nothing in the views for that model, other than a customised
index.dryml file. I'd added Bryan's paperclip and jQuery bits from his
cookbooks, in there - and was thinking of that file as a application-
wide resource, not one that held model specific code.

Obvious in retrospect - as most of these things are. :(

Thanks for your help, again.

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