I have a RABL template as shown below
object @user
attributes :name
child :contacts do
# does not work
if contact.is_foo?
attributes :a1, :a2
else
attributes :a3, :a4
end
end
How do I access the Contact
object in the child
block of the template? I need to perform some conditional logic on the child instance.