Question

I'm trying to do something like this:

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
Was it helpful?

Solution

For those people who finds this question through a search or google.

Niels started an issue on Github which can be found here.

A developer created a great solution for this which has been merged into rabl since v0.6.2.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top