Not sure from your question, you seem to be asking “How do I sort the
Categories index?” but you’ve provided a link_to that deals with a
Category. Typically, you’ld order your Categories in the controller
method and the ordered list would be available in the index.html.erb
as @categories. You could then step through this list in your view with
@catagories.each do |category|.
If that’s what you’ve done then “category” (in your link_to) should be
id of a single category.
At any rate, you would really help yourself by getting familiar with the
Rails Guides at http:guides.rubyonrails.org.