| 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:
|
- [merb] Writing specs for controller methods Ashley Moran
- [merb] Re: Writing specs for controller methods Per Melin
- [merb] Re: Writing specs for controller methods Matt Aimonetti
- [merb] Re: Writing specs for controller metho... oleg dashevskii
- [merb] Re: Writing specs for controller m... Yehuda Katz
- [merb] Creating multi-level params t... Julian Leviston
- [merb] Re: Creating multi-level ... weepy
- [merb] Re: Creating multi-le... Yehuda Katz
- [merb] Re: Creating multi-le... Julian Leviston
- [merb] Re: Creating multi-le... Yehuda Katz
- [merb] Re: Creating multi-le... Matt Aimonetti
- [merb] Re: Creating multi-le... Michael Klishin
- [merb] Re: Creating multi-level ... weepy
- [merb] Merb-Auth and Merb-Sl... Nik Radford
- [merb] Re: Merb-Auth and Mer... Daniel N
- [merb] Re: Merb-Auth and Mer... Nik Radford
- [merb] Re: Merb-Auth and Mer... Jarkko Laine
- [merb] Re: Merb-Auth and Mer... Daniel N
- [merb] Re: Merb-Auth and Mer... Jarkko Laine

