collection.detect is O(n). Perhaps an easier way is to map the resource to a hash? something like this:

h = Hash[ collection.map{ |o| [o.id,o] } ]
params[resource_instance_name].each_with_index do |id, i|
    r = h[id]
    r.position = i + 1
    r.save
end