Hi 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 : <div id="drag_params"> <p id="param1" class="params" alt="nosc">TEST DRAGGABLE</p> <%= draggable_element "param1", :revert => true%> </div> <div id="cart" class="cart" style="border:3px solid black; width: 200px; height:200px;"> <%= render :partial => "cart"%> </div> <div id="indicator" style="display:none;"> Params are updating... </div> </div> <%= drop_receiving_element "cart", :update => "drop_params", :url => {:action => "add"}, :accept => "params", :hoverclass => "cart-active", :loading => "Element.show(''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] ||= {} end def add render :partial => "cart" end Partial cart goes: <% session[:pipe].each do [param]%> <div id="drop_params"> </div> <% end %> I priciate for your help --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 string. 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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I didn''t get it work. Can you give me a sample for function :with, how I can store information. On 17 heinä, 11:40, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> 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 > string. > > 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.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---