I think this would work:
#view
<%= hidden_field_tag "sites[#{site.id}][id]", site.id %>
^^^^^^^^^^ ^^
#Add this in your view
#controller
def update_all_sites
params[:sites].each do |attributes|
Site.find(attributes.delete(:id)).update_attributes new_attributes
end
#etc.
The .delete(:key)
method on Hashes will delete (NO WAY!?) the corresponding Key/Value pair and return the value, example in IRB console:
1.9.3p448 > a = {b: 12, c: "bonjour"}
# => {:b=>12, :c=>"bonjour"}
1.9.3p448 > a.delete :c
# => "bonjour"