On Jul 16, 2010, at 12:57 PM, Henry Baragar wrote:

Hello,
I need to provide a web page in a Hobo application for uploading a file that contains data for generating a whole bunch of records. The file is discards after the data is processed.
What is the Hobo way of doing this?
        • Create a Webform and use the Rails file_field_tag?
        • Create a LifeCycle and use the Rails file_field_tag?
        • Do it the Rails way?

I'm not sure there's an official "Hobo way" to do this; the Rails uploaded file stuff will definitely come into play at some point.

One approach I haven't seen get much coverage, though, is a two-step approach. First, you upload the file (pick your favorite plugin - Paperclip, etc) and create a corresponding database record. Then, the user has a link in the UI to "process" the file, which can take more parameters *and* has the luxury of having the to-be-processed file handy.

In my use case, it was absolutely necessary to have that access, since the "process" step allows the user to control the mapping of columns in the uploaded CSV to columns in the model. (They were uploading files provided by *their* clients, and didn't want to hassle with moving stuff around manually). The other win was that "failed" rows from the import could be dumped into a new file record, so they could be corrected (if they didn't pass validation) or just ignored (if somebody left useless nearly-blank rows, etc).

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

Reply via email to