If I want to render a partial that does not require an object, like:
# some_template.json.rabl
node(:common) do
# I cannot do like this
# partial('common/duration_units')
# and like this
# partial('common/duration_units', object: {})
# I have to do:
partial('common/duration_units', object: {a: 123})
end
# common/duration_units.json.rabl
node(:available_duration_units) do
DURATION_UNITS.map do |unit|
{
name: unit.name,
multiplier: unit.multiplier
}
end
end
From my point of view it is not the best solution and there should be a way to render a partial without an object.
Another way is to use extends but I completely fail to understand how to use it whatsoever
If I want to render a partial that does not require an object, like:
From my point of view it is not the best solution and there should be a way to render a partial without an object. Another way is to use
extends
but I completely fail to understand how to use it whatsoever