gpt4 book ai didi

ruby-on-rails - 是否可以在 rabl View 中进行片段缓存?

转载 作者:行者123 更新时间:2023-12-04 15:36:22 26 4
gpt4 key购买 nike

我正在尝试做这样的事情:

cache "api/v1/cars_index/#{I18n.locale}/car/#{car.cache_key}" do
attributes :id, :brand, :model_name, :fuel, :km, :year, :price
node(:color) { |car| car.color.present? ? car.color : '' }
end

最佳答案

对于那些通过搜索或谷歌找到这个问题的人。

Niels 在 Github 上发起了一个问题,可以找到 here .

开发人员为此创建了一个很好的解决方案,自 v0.6.2 以来已合并到 rabl 中。

关于ruby-on-rails - 是否可以在 rabl View 中进行片段缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8384244/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com