AngularJS implementation of hierarchical lists in Rails