I am building a Rails 3.2 app and I am using Rabl templates. I would like to add a "root node" that displays the total number of records. The solution below adds the total node to each record. I want it on top of all records.
collection @projects
extends "projects/_base"
node(:total_entries) { @projects.total_count }
I want it to be like this:
- total_entries: 3
-- Entry 1
-- Entry 2
-- Entry 3