Django for example will throw an error if an ordering parameter does not correspond to a database column.
If you have to specify all the columns of a table in Rails, then ActiveRecord ought to be able to restrict the order params to only column names.