Hello guys, I'm a scriptaculous newbie (I started working with it only
yesterday) and I have already the first problem.

I'm trying to implement a drag & drop list (fallowing the shopping
cart example http://demo.script.aculo.us/shop)  and  I'm almost done
but after dropping an item on the target div I need to refresh the
page to see that the item has been moved. This happens even if I
render the partial on my controller (just to test it I use only 1 item
stored on the session variable)

[code]
def add_item_to_selected
     item_id = params[:id]

     session[:selected_items] = item_id

     render :partial => 'items'
   end
[/code]

The other code is below

[code]
#view

<div id="itemList"><%= render :partial => "item_list"%></div>

<div id="selectedItems"><%= render :partial => "items" %></div>


<%= drop_receiving_element "selectedItem",
:update => "items", :url => { :action => "add_item_to_selected" },
:accept => "my_item",
:loading => "Element.show('indicator')",
:complete => "Element.hide('indicator')" %>

#_item_list
<ul id="items1">
        <% @item_list.each do |item| %>
                <% domid ="#{item.id}" %>
                <li class="my_item" id='<%= domid %>'><%= item.name%></li>
                <%= draggable_element domid, :ghosting => true, :revert => true 
%>
        <% end %>
</ul>

#_items
<ul id="item2">
        <% session[:selected_items].each do |item| %>
                <% domid ="#{item.id}" %>
                <li id='<%= domid %>'><%= Item.find(item).name%></li>
                <%= draggable_element domid, :ghosting => true, :revert => true 
%>
        <% end %>
</ul>

<%= "move here your selected items" if session[:selected_items].empty?
%>

[/code]


What's wrong with my code ????

THANK YOU, I APPRECIATE YOUR HELP
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to