http://merbivore.com/documentation/current/doc/rdoc/merb-helpers/index.html?a=M000440&name=fields_for

Might be a place to start.

-Matt

On Mon, Oct 20, 2008 at 1:36 AM, Yehuda Katz <[EMAIL PROTECTED]> wrote:

> At one point I had an idea for a simple DSL for creating a model-like
> object that could be used in form_for but represented multiple models. Could
> you spec out how you'd expect something like that to work? I've been meaning
> to work on something like this for ages.
> -- Yehuda
>
>
> On Mon, Oct 20, 2008 at 12:58 AM, Julian Leviston <[EMAIL PROTECTED]>wrote:
>
>> Hey Yehuda man :)
>> Here's a great example, from a project I'm working on right now:
>>
>>
>> ToobieToob has a number of teams and businesses, and each team has a
>> number of media files. The plus buttons on the very right of each element
>> adds more (using AJAX) and no changes persist until a set of validated
>> records are saved in the database (ie multiple enclosed transactions).
>>
>> This is one example. We have a couple of way more complex examples. (think
>> the same, but with 8 models including sub-models being saved at the same
>> time).
>>
>> This is the primary place where Rails falls down. We have
>> ModelName.update_all(params[:model_name].keys, params[:model_name].values)
>> which "handles" this-style of thing, but doesn't actually provide n-tiered
>> options where n is any value greater than 2. (ie you can have ToobieToob
>> above, and its people/teams, but not media files, and it doesn't handle the
>> validation for you, either).
>>
>> On the one hand, this is something which should be handled by the coder,
>> but on the other hand, having a best practice for this type of thing would
>> save countless HOURS of most coder's lives (probably mine included, tho we
>> have a mini-framework for this now... it's not the best, but it works).
>>
>> Now, if you look above, you'll also see there is a file upload box in the
>> media files sub-sub-section. ;-) And this works. It handles multiple file
>> uploads and deletes vai the form (when you add a file, the plus turns into a
>> minus).
>>
>> Julian.
>>
>>
>> On 20/10/2008, at 6:42 PM, Yehuda Katz wrote:
>>
>> Yeah, If you can provide some details I'd be glad to see what we can do ;)
>> -- Yehuda
>>
>> On Mon, Oct 20, 2008 at 12:23 AM, weepy <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Sorry - what do you mean by "multiple-level items"  ?
>>>
>>>
>>> On 20 Oct, 07:46, Julian Leviston <[EMAIL PROTECTED]> wrote:
>>> > One of the biggest requests from noobs I see everywhere is how to do
>>> > multiple-level items in Rails.
>>> >
>>> > If we had a method of doing this that was "standard", it would be the
>>> > one of the biggest ways that I can think of to attract new users.
>>> >
>>> > Make a vid, and it'll spread like viral pancakes.
>>> >
>>> > Of course, all the Rails guys looking at this list would just hawk the
>>>
>>> > code and build it into Rails, but I guess that's what's so great about
>>>
>>> > Open Source, hey.
>>> >
>>> > :-)
>>> >
>>> > Julian.
>>>
>>>
>>
>>
>> --
>> Yehuda Katz
>> Developer | Engine Yard
>> (ph) 718.877.1325
>>
>>
>> >>
>>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

<<inline: pastedGraphic.png>>

Reply via email to