ruby on rails - Storing navigation structure -


I need a way to store the nested navigation structure I do not want to use the database for it, like tree-like structures There are a lot of headaches in storing.

I want some space to keep this structure as a text file, so that I can easily change during development.

What are my best options? YAML? XML?

I throw complex navigation structures into a helper myself and call it good if you External, but I will put together a config / nav.yml file:

  - url: 'root_path' - text: colors url: 'colors_path' nodes: - Text: Blue URL: 'Blue-Path' - Text: Red URL: 'Red_Path'   

Then when this project is loaded, the Yimal file is loaded into global stability:

  NAV = YAML.load_file (file.joi) N (RAILS_ROOT, 'config', 'nav.yml')   

Then in the view you will iterate nav still.

Comments