navigation list order by

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 single Category. Typically, you’ld order your Categories in the controller index method and the ordered list would be available in the index.html.erb view 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 the id of a single category.

At any rate, you would really help yourself by getting familiar with the Rails Guides at