Is it possible to cache fragments in the form of rabl?

I am 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 
+6
source share
1 answer

For those who find this question through search or Google.

Niels started asking a question about Github, which can be found here .

The developer created an excellent solution for this, which has been combined with rabl since the release of v0.6.2.

+3
source

Source: https://habr.com/ru/post/903094/


All Articles