Sortable list with non ajax submission


I am trying to create a sortable list that is submitted not with an AJAX
call but by a standard form submit button.
Right now I have

def reorder_group_members
@group = Group.find(params[:id])
@group.group_members.each do |member|
member.position = params[:memberlist].index( + 1
#I get a nil error for this line. It would seem that
params[:memberlist] is not getting set.
render :action => ‘index’

with view

<%=start_form_tag :action=>‘reorder_group_members’, :id => @group%>

    <% for member in @group.group_members-%>
  • <>
  • <%end%>
<%=submit_tag%> <%=end_form_tag%> <%= sortable_element 'memberlist' -%>

This works fine in terms of the member list being sortable by dragging
but when I click the submit button I get a nil error because the sorting
information is not being passed as a paramater. Any ideas?

Thank you,
Matthew M.