Hi,
I''m new to the script.aculo.us library and AJAX. Of course, I already
want to use a sortable list for something more complicated than the
sortable list demo. In the example below, what is the structure of
params[:list]? I don''t know what I can do with it once I have it in my
controller method.
Thanks,
Peter
# view
<ul id="list">
<% 6.times do |i| -%>
<li id="item_<%= i+1 %>">I''m number <%= i+1
%></li>
<% end -%>
</ul>
<p id="list-info"></p>
<%= sortable_element ''list'',
:update => ''list-info'',
:complete => visual_effect(:highlight, ''list''),
:url => { :action => "order" } %>
# controller
def order
@order = params[:list]
render :partial => ''list''
end
# _list.rhtml partial
Updated order is: <%= @order.join('', '') %>.