Sessions+draggable element


I am doing draggable element with sessions. But sessions are new to
me. I have a draggable_element which should be dragged to the cart. I
have defined action add for receving element. How I can delivery
variable or text to the receving element

So my view goes :


<%= draggable_element "param1", :revert => true%>
<%= render :partial => "cart"%>
Params are updating...

<%= drop_receiving_element “cart”,
:update => “drop_params”,
:url => {:action => “add”},
:accept => “params”,
:hoverclass => “cart-active”,
:loading => “‘indicator’)”,
:complete => “Element.hide(‘indicator’)”%>

Contoroller goes :

In controller I have no idea what I should do. I have done few
sessions with php, but not with rails.

def index
session[:pipe] ||= {}

def add

render :partial => "cart"


Partial cart goes:
<% session[:pipe].each do [param]%>

<% end %>

I priciate for your help

drop_receiving (like most other js helpers of that type)
has a option :with, which allows to add additional information
to the call

:with - A JavaScript expression specifying the parameters for
the XMLHttpRequest. Any expressions should return a valid URL query

In the controller you just store the information you received
You can do that in the session (which basically is just a hash)
or in a db table.

I didn’t get it work. Can you give me a sample for function :with, how
I can store information.