what is the best method of handling the common scenario of having
say , 2 lists read from a DB, one side with an "Add" link and one
side with a "Remove" link. Clicking on either link does some sort of
effect and then re-populates the whole thing.
Should i put each section in its own <div> and then render a partial
for the section _not_ clicked like:
<div id=add>
item 1 <%= link_to_remote("Add", :url => {:action =>
"add"} , :update => "remove", :loading => "new
Effect.Fade
(''item1'')" ) %>
item 2 <%= link_to_remote("Add", :url => {:action =>
"add"} , :update => "remove", :loading => "new
Effect.Fade
(''item2'')" ) %>
</div>
<div id=remove>
item 3 <%= link_to_remote("Remove", :url => {:action =>
"remove"} , :update => "add", :loading => "new
Effect.Fade
(''item3'')" ) %>
</div>
clicking on item 1 or 2, will do an effect, remove it from the list,
call an action that actually removes it from the DB, and finally
render a partial that populates id=remove, and vice versa ?
thanks
adam