entrance-exam/app/helpers/questions_helper.rb

5 lines
148 B
Ruby

module QuestionsHelper
def reorder_with_indices(array, indices)
array.sort {|a1, a2| indices.index(a1[1]) <=> indices.index(a2[1])}
end
end