0
如果我有一些東西的集合,比如說Widgets,並且我正在使用Active Model Serializer來序列化Widgets集合,那麼我如何將instance_options傳遞給集合呢?活動模型序列化器:如何將選項傳遞給集合?
render json: @widgets, count: 40
我嘗試了上面,我似乎無法得到count: 40
我instance_options
。我錯過了什麼嗎?
我想你可以通過本地人。 'render json:@widgets,locals:{count:40}' –