How can I convert this PHP script to Ruby? (build tree from tabbed string)
- by Jon Sunrays
I found this script below online, and I'm wondering how I can do the same thing with a Ruby on Rails setup.
So, first off, I ran this command: rails g model Node node_id:integer title:string
Given this set up, how can I make a tree from a tabbed string like the following?
<?php
// Make sure to have "Academia" be root node with nodeID of 1…