Assuming you are using Rails 3
<%= Specimen.limit(10).order("distribution_sheet_id").all %>
Note that if you limit more than 1 entry, you cannot call #id at the end, because the result is an array.
To get all identifiers
<%= Specimen.limit(10).order("distribution_sheet_id").map(&:id) %>
For Rails 2.3, use the old hash conditions.
<%= Specimen.all(:order => "distribution_sheet_id", :limit => 10) %>
and the same goes for id
<%= Specimen.all(:order => "distribution_sheet_id", :limit => 10).map(&:id) %>
Here I use the #to_sentence method to join all IDs. Adapt the code according to your use case.
<%= Specimen.all(:order => "distribution_sheet_id", :limit => 10).map(&:id).to_sentence %>
source share