I looked at this code again, and I think it is kind of a mess. This is not the first approach I have taken to this issue, but it is the one closest to operational.
The hobo-idiomatic way to do this would be to include response_attachments in a field list. I tried that, but when I try to add a file, it shows the four paperclip fields as edit controls, rather that the file picker presented in this approach. If there's a hobo-consonant way to put the file picker in the add-a-file section of the input-many, I am all ears. Thanks! On Sunday, May 3, 2015 at 8:39:30 PM UTC+7, [email protected] wrote: > > I have some dryml that manages response_attachments that belong_to > responses. The first form shows the current response_attachments in a > table, each with a delete-button. The second form is used to add a > response_attachment to the relation, and updates the table. > > Here is the dryml code: > > http://pastie.org/10126600 > > This works mostly well, but there is a problem with the code generated for > the first element: it links to the responses controller, not the > response_attachments controller, the the delete button errors out. It seems > to do this because the first button does not get wrapped in a form, but > later ones do. > > Here is the HTML generated, for the first, inoperative row, starting on > line 3, and for the later, correct rows, starting on line 19. > > http://pastie.org/10126635 > > If I add a new response_attachment to the relation using the second form > without reloading the page, the new ajax-inserted delete button gets the > form operates correctly. If I delete a response_attachment other than the > first, the ajax-inserted top button also operates correctly. > > I have tried replacing the table with a collection with similar content, > with the same results: the first delete button does not work, and the > delete buttons other than the first are fine. > > I have a feeling there is a way to simplify and combine these two forms, > but I will take any operable solution. > > Thanks so much! > > Paul Davis > > > -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/hobousers. For more options, visit https://groups.google.com/d/optout.
