I really love the simple-navigation gem but there are some problems. My 
configuration file is structurally identical to my routes file. That 
redundancy is bad enough  *but* if I navigate to a url that 
simple-navigation can't catch, it fails completely.

So I'm attempting to auto-generate my navigation directly from my routes, 
so that there's a navigation item for every possible route and "going off 
the map" is impossible.

An example:
resources :widgets should create a nav_item corresponding to the url 
"widgets." This nav_item should have some children nav_items corresponding 
to the show and edit widgets urls. 

I've had good progress but simple-navigation stores nav_items in what is 
essentially a tree structure while routes are stored as a list. I want to 
maintain the structure of my routes.rb, so this poses a bit of a problem. I 
tried to find the children of a route by regex'ing the all the url's but 
this won't guarantee that I maintain the structure of my routes.rb file. 

So my question is this: How do I extend Journey::Routes so that the 
"widgets/" route maintains a parent-child relationship with it's "derived" 
routes?

My work so 
far<https://github.com/adamwong246/StEnki/blob/master/lib/core_extensions/route.rb>
my routes.rb<https://github.com/adamwong246/StEnki/blob/master/config/routes.rb>
A half-working attempt. Might be slow to load, I can't afford anything 
better. <http://ifailedtheturingtest.herokuapp.com/pages/files/nav.html.slim>


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/waoI1UE0hsQJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to