例如,我有一个代表看起来像:
module AccountRepresenter
include Roar::Representer::JSON
include Roar::Representer::Feature::Hypermedia
property :id
property :name
collection :assets, :extend => AssetRepresenter, :class => Asset
end
在控制器中,我将其用作:
respond_with @accounts, represent_with: AccountsRepresenter
对于另一个我不想collection :assets
被呈现的动作。我试过了
respond_with @accounts, represent_with: AccountsRepresenter, exclude: :assets
但它不起作用。我应该如何将参数传递给代表?