I'm wondering if anyone can help with the following?

I am trying to build a form that will allow a user to view a grid of scraped 
image thumbnails,
 and delete a subset of these.

I am stuck trying to understand how to wire the form. I'm wondering if there is 
an example that 
shows how to select a subset of has_many associations to delete?

 My app has two models: ScrapeJob and Scrape


ScrapeJob represents an entire page

Scrape holds a single image (using paperclip) 

has_attached_file :photo,
       :styles => {
         :thumb=> "100x100#",
         :small  => "400x400>" }

ScrapeJob  has_many :scrapes

When a ScrapeJob is created it uses a callback to scrape the chosen page after 
the model object is written to the DB

after_save :start_scraping

I have extended the Card for Scrape so that the ScrapeJob show page shows the 
images 

<extend tag="card" for="Scrape" >
  <old-card merge>
    <heading: param> 
        <img src="#{this.photo(:thumb)}"  />         
    </heading:>
  </old-card>
</extend>


My challenge is making the edit page work.

I understand that <select-many> and <check-many> work with existing objects, 
whilst the tag <input-many> is intended for new objects.


When my edit page looks like this

<def tag="edit-page-new">
  <edit-page merge>
    <content-body:>
      < select-many:scrapes><img src="#{this.photo(:thumb)}"  /> </select-many>
    </content-body:>   
  </edit-page>
</def>
<edit-page-new/>

I see a list of scrapes, though not the images, and I can remove items from the 
list, but I do not have a save button to save the change.

If I use <input-many:scrapes> in place of <select-many> then my form does show 
each image, with a remove-item button adjacent to each image,  but still 
doesn't do anything.

Is there an example that might point me in the right direction here?

Much thanks,

Peter Booth

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