Suggestions for Recipes
Michael Schu...
4 posts
|
I’ve got the beta book and it looks quite good already. I have a few qualms about the title as I’m not convinced that those recipes really are “advanced” as compared to “more”. Anyway, I take it there are still a few pages to be filled and these are my suggestions:
|
Skyblaze
16 posts
|
i agree with the above topics. Then it would be great to insert some in-dept recipes for real topics too…. |
Hemant Kumar
2 posts
|
If Mike agrees, I can write a recipe on BackgrounDRb. Its rather correct time to have this up, since BackgrounDRb 1.0 release will be out there in a day or two. |
Mike Clark
Administrator
26 posts
|
Hemant wrote a great recipe on the latest version of BackgrounDRb in the latest beta version which was just uploaded today. Thanks, Hemant! |
William DeVaul
2 posts
|
Has a decent pagination resource been covered somewhere extensively? If not, how about a recipe for improved pagination? |
Mike Clark
Administrator
26 posts
|
William: I use will_paginate: |
William DeVaul
2 posts
|
Thanks Mike. That is very helpful. I would +1 on the multi-form model, e.g. a multi-page checkout screen. Bill |
Mike Clark
Administrator
26 posts
|
William: Thanks. The multi-model form recipe is in the latest beta revision, along with a recipe for a wizard-like interface. |
Alain Ravet
1 post
|
When I need a progress bar in a screen, I use a super simple Ajax Request-chaining technique that I call “Action Chunking”. It’s basically 4 lines of code + some code reorganisation; it doesn’t require any plugin or special server configuration. See :
I don’t remember seing this elsewhere, so it could maybe turn into a recipe. |
eddie may
5 posts
|
I second (or third, fourth, ...) the admin UI recipe suggestion. I recently moved some controllers + views into an admin directory & had problems getting it to work until I added the admin ‘directive’ to the form in the view like so: |
eddie may
5 posts
|
One more thought! Thanks again. |
eddie may
5 posts
|
Ok, this may be too ambitious for a recipe or even completely off topic, but here goes anyway! Imagine a situation where you need to create an application for selling a multiplicity of different products – cars, motorbikes, paintings, antiques, etc, etc. Each product has different attributes – cars have a model and manufacturer, paintings have an artist & title. Similar (manufacturer = artist, model = title) but not the same! One approach might be to have a ‘products’ table with common fields such as id, price & then generic such as field3, field4, field5, etc, etc. Then one could subclass the ‘Product’ class with a Picture class that would define what field3, field4 for this class are called (field3=Artist, field4 = Title, etc). How would/could such a ‘dynamic’ approach work with rails? Most of the examples I’ve seen re: rails are relatively straightforward mappings between a ‘products’ table and a ‘Product’ class. Thanks |
eddie may
5 posts
|
Last one, I promise! A clear explanation and example of the use of dynamic vs static scaffolding. Thanks |
David Wilbur
4 posts
|
for me the upload chapter would be more helpful, and not yet another example of how to upload images in rails, (of which the other book from pragmatic “rails recipes” covers as do many other places on the web) if it were to talk more about general file uploading and post-processing. even just doing this google search “upload image rails example” points you at this and many other examples, http://clarkware.com/cgi/blosxom/2007/02/24 which seems to be the source of this recipe. an example of other common forms of post processing might be, taking a tab or csv file with additional data about the “album” and saving that data to the database. another might be taking a ”.doc” file and converting it to a format that could be displayed from a rich text field in a database, like say people were asked to upload reviews of this “album”. as was said above in the thread, the current state of the upload chapter is to me a case of more information, not more advanced examples. |
Mike Clark
Administrator
26 posts
|
Eddie: Rails 2 no longer has dynamic scaffolding, and Recipe #1 has an example of the new static scaffolding. Thanks for the other suggestions! |
Mike Clark
Administrator
26 posts
|
David: Thanks for your thoughts. I get a ton of email related to my attachment_fu blog, so I thought expanding it a bit in the book to answer common questions might be well received. I’d like to incorporate some additional information folks have suggested in this forum, as well. Rather than convert it into a generic file upload recipe, I’m thinking a separate recipe on, say, uploading a CSV file might be warranted. Thanks everyone! Please keep the suggestions coming. |
David Wilbur
4 posts
|
Mike, if you are going to do the csv, might i suggest the following to be clear about what i am suggesting. there are many examples of how to store objects uploaded into the database, most of them are about images. what i think would be useful is to have an example of how to take apart the csv and put that data into the appropriate database fields related to say the album for example. say you had an album csv like this: album_id,album_name,album_release_date,etc… that it would loop through the csv, and do a find based on maybe album_id and if it did find it that it did an update, otherwise i would do an insert. that would be truly useful to people that are using rails in a corporate environment where they might have tons of data being generated by other systems and wanted members of the corporation to say aggregate that information in a rails app. thanks for listening, |
Bobby Santiago
1 post
|
One recipe I would appreciate: automated photo uploads to S3 using attachment_fu and BackgrounDRb, with the background process updating the UI with progress re thumbnail generation/saving. |
18 posts, 9 voices
