私のモデル
class Client < ActiveRecord::Base
  attr_accessible :name
  has_many :bookings
  validates_presence_of :name
end
class Agent < ActiveRecord::Base
  attr_accessible :name
  has_many :bookings
  validates_presence_of :name
end
class Booking < ActiveRecord::Base
  attr_accessible :booking_time, :agent_id
  belongs_to :client
  belongs_to :agent
  validates_presence_of :booking_time
end
これは頭を悩ませています。エージェント側とクライアント側の両方から予約を表示したいのですが、予約コントローラーのインデックス メソッドでルートを処理するにはどうすればよいでしょうか?
agents/agent_id/bookings and clients/client_id/bookings?
2 番目の質問: クライアントのみが予約を作成しますが、予約とエージェントの間の関係を正しく維持するにはどうすればよいですか?
  def create
    @client = Client.find(params[:client_id])
    @booking = @client.bookings.build(params[:booking])
    @agent = Agent.find(params[:booking][:agent_id])
    @agent.bookings << @booking
    if (@booking.save and @agent.save)
      redirect_to [@client, @booking]
    else
      render :action => "new", :notice => "Booking could not be created"
    end
  end