Forum: Ruby on Rails drag&drop strangeness

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Marco Milanesi (Guest)
on 2006-04-16 00:30
(Received via mailing list)
hi people!

	I have a view like this:

# list.rhtml
  <form id="search">
    <ul style="list-style: none;">
      <div id="searchfields">
                <%= render "contacts/search_fields" %>
      <div id="trash">
		trash me
        <%= drop_receiving_element "search",
              :update => "searchfields", :url => { :action =>
"add_search_field" } %>
        <%= drop_receiving_element "trash",
              :update => "searchfields", :url => { :action =>
"remove_search_field" } %>

and another view that is the 'ajax' rendered view:

# search_fields.rhtml
<% session[:search_fields].each do |field, surely_empty| %>
        <span id="<%= field %>"><li><label for="<%= field %>"><%= field
%>:</label><%= text_field_tag field %></li></span>
        <%= draggable_element field, :revert => true %>
<% end %>

add_search_field and remove_search_field are removing from the session a
field and search_fields.rhtml as you see reprints all the fields

I want to trash a field by moving it to the trash div.

steps are the following:

I have a table with a  <%= draggable_element column.human_name.downcase,
:revert => true %> and if I drag it to search_fields (it calls
add_search_field in the controller) it works and renders correctly.

then if I try to drag the newly added field to trash I'm unable to do it
because it doesn't drag. If I reload the page and then drag&drop it

what am I missing?


a hack that could be done, but I don't know how to do it is to force the
of the entire page


 ,= ,-_-. =.
((_/)o o(\_)) 
 `-'(. .)`-'         online on #muppetslab at
     \_/        There's no one inside that flat, everybody knows it
This topic is locked and can not be replied to.