On Tue, Jul 27, 2010 at 2:09 PM, Skott Klebe <[email protected]> wrote:
> I'm frustrated with DRYML and Rapid.
> I can sense the power, but I can't figure out how to get at it.
> Literally everything I try to do breaks, and I can't figure out why.
>
> For instance, I have an array of model instances returned by find.
> I'd like to try something like this:
> <repeat with="&@all">
> <collection/>
> </repeat>
>
> where @all=<Model>.find :all, populated in the controller. This seems
> like a minimal change from what's in the Agility tutorial, and I can't
> tell what's wrong, but I get a method missing exception on empty?.
> Eventually I gave up on using <collection> entirely.
The docs for <collection> should probably be more explicit - it
expects that the context will be an array. So your example would
shorten to:
<collection with="&@all" />
As previously written, it was attempting to call the collection tag
once for each element in @all, which obviously didn't do what you
want. :)
>
> I want to modify the edit form so that it shows a textarea instead of
> an input type='text' for one field, and there doesn't seem to be any
> end to the work. I create the edit-page, I drop the field from the
> field_list, and add the field back in; now it doesn't get put into the
> table of label/field combos, and doesn't have a label.
> According to the Rapid doc, it seems like I would get a textarea
> automagically if I declared the field in my model as note instead of
> string, but I shouldn't have to change the data layer to get the
> presentation layer that I want. I feel like there's should be a
> simpler way to do this, but for the life of me I can't find it in the
> doc.
Note that if you're attaching a multiline field to an attribute, you
may actually want to change the datatype; some DBs (MySQL, as an
example) limit :string types to pretty pathetically short lengths
(255, I believe). YMMV depending on your target DB.
In any case, if you just want to swap out one field's tag in a list,
you could do this (assume the field is called special_field):
<field-list fields="...">
<special-field-tag:>
<input for-type="text" />
</special-field-tag:>
</field-list>
This may need tweaking to match the surrounding context (field-list
may be a param, for instance) but it sounds like you've already got
that part figured out.
> At this point I feel like I've killed 24hrs of duration and close to
> 10hrs of effort on simple functionality that would have taken one or
> two minutes to do in erb or haml. Neither erb nor haml offers the
> promise of modularity and nearly semantic markup that DRYML seems to,
> but then, I've never had as much trouble making simple markup changes
> before.
>
> There's deep thinking about the structure of web apps embedded in
> DRYML and Rapid, but I'm running out of time to leverage it.
>
> Should I keep going? Does it take one or two days of absolute
> paralysis before I'll start to be able to jump higher and farther than
> ever before?
It does take a while - and the current state of the documentation for
the taglibs doesn't exactly help. In the meantime, we always try to
respond ASAP to questions, so ask away! :)
--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.