私は次のデータベースを持っています:
class User < ActiveRecord::Base
has_and_belongs_to_many :apps
class App < ActiveRecord::Base
has_and_belongs_to_many :users
ユーザーのビュー( )で、現在のユーザーが持っているアプリでソートされたすべてusers/show.html.haml
のアプリを一覧表示します。
%table
%thead
%tr
%th Name
%th Available
- for app in App.order("??????")
%tr
%td= link_to app.name, app_path(app)
%td
- if @user.apps.include?(app)
%i.icon-ok
- else
%i.icon-remove
私の質問は、並べ替えを行うためにorder関数に何を入れるかです。