But it isn't. No AJAX. No RJS. Nothing showing up in FireBug. Just a silly _javascript_ bit that hides it and sets the value to "".  It seems that they intentionally used this alternative method instead of instead of AJAX.  Perhaps because it doesn't delete the records until you update the list.

The script:
<script>
  function deleteItem(id) {
    document.getElementById('item_' + id + '_content').value = ''; 
    document.getElementById('item_' + id).style.display = 'none'; 
  }
</script>
Then something in the model or controller that does a bit o' magic to figure out if it has been deleted, then removes from the database.  Something like:

Item.update_or_delete(params....)

I was just wondering if anybody knew if that existed. I tried a before_save callback to delete empty objects, but it wasn't working.

-Nathan


Patrick Crowley wrote:
Yeah, exactly.

Nathan... my example wasn't hypothetical. I just built something like this for chumby using RJS. (Email me off list if you need more help.)

-- Patrick


On Mar 7, 2007, at 7:40 PM, Bradly wrote:

My guess would be RJS templates.

-Bradly


On 3/7/07, Nathan Colgate Clark <[EMAIL PROTECTED] > wrote:Yeah. I'll probably end up doing that.  Most of my desire to know is
"How did 37Signals do that...?" and then the "One request instead of
multiple" appeal...

Thanks,

-Nathan
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby




_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to