持っている:
class User < WsBasedPlainRubyObject
def subscriptions
Subscription.where(:user_id=>self.id)
end
[...]
end
class Subscription < ActiveRecord::Base
has_user #using an underlying composed_of
[...]
end
resources :users do
resources :subscriptions
end
user_subscriptions_path(@current_user)ビューでヘルパーメソッドを使用しようとすると、params[:user_id]コンテンツにIDではなくユーザーのシリアル化が含まれます。
ActiveModelを使用して、これを回避する実用的な方法はありますか?