New plugin: Routing Navigator

rick : June 19th, 2006

The hardest part about using the "simply_restful":http://dev.rubyonrails.org/browser/plugins/simply_restful plugin is dealing with all new routes it generates. After struggling through RailsDay with crazy custom routes, courtenay suggested modifying my "routing navigator view":http://rpaste.com/pastes/198 so it showed the current controller's routes at the bottom. Here's a "video":http://techno-weenie.net/files/routing_navigator.mov (804k) of it in action. Check out the new plugin:

  script/plugin source http://svn.techno-weenie.net/projects/plugins
  script/plugin install routing_navigator
Or grab it from "svn":http://svn.techno-weenie.net/projects/plugins/routing_navigator/.

10 Responses to “New plugin: Routing Navigator”

  1. Alex Wayne Says:
    Does this only work on edge rails? I tried to use it and got:
    undefined local variable or method `named_routes' for #<actioncontroller::routing::routeset:0x33cbb78>
    And sadly, I cannot use edge rails due to the fact that routes crash with :requirements set. http://dev.rubyonrails.org/ticket/5320#preview
  2. David E Says:
    Great utility. This should be in core!
  3. Adam Sanderson Says:
    wow, that looks really neat :)
  4. rick Says:
    alex: yup, edge only. Do you have a small routing snippet that's proven to fail? I've converted 3 completely different apps with minimal changes.
  5. Alex Wayne Says:
    The latest patch that came in yesterday greatly helped, but I am still getting an error with one of my routes. The route:
    
      map.with_options(:controller => 'account') do |route|
        route.wishlist 'wishlist/:id',
          :action => 'show_wishlist',
          :id => nil, #added for troubleshooting, but no help.
          :requirements => {:id => /\d*/}
      end
    
    
    The method call:
    
      <%= link_to 'My Wishlist', wishlist_url %>
    
    
    The error:
    
      ActionView::TemplateError: can't convert nil into String
    
    
    The stacktrace:
      
      
        #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:29:in `<<'
        #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:29:in `rewrite_url'
        #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb:11:in `rewrite'
        #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:487:in `url_for'
        #{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/routing.rb:887:in `wishlist_url'
        (eval):2:in `wishlist_url'
      
    
  6. Alex Wayne Says:
    I take that back. It's miraculously working now on [4470]. I didn't change anything, too wierd for my liking, but I'm willing to assume its a non issue. Great plugin btw!
  7. uvamvlppbh Says:

    Thanks for this site! traverse city friends north gay gay annapolis nightlife mister gay south carolina mickey rooney & gay lance gear - gay escort truckdriver association gay gay male masterbation gay boy gallerie gay piss enemas statistics concerning gay marriage film festival honolulu gay francis bacon gay lori petty gay gay thumbs nl shower curtain gay why is nguyen so gay denver gay neighborhood gay boy shirtless gay men bulge picture gallery gay male feet worship pics west hollywood gay massage gay six pack hunk movies

  8. steve Says:

    This is cool - the comments that say it only works in edge Rails are a little misleading, since what was once “edge” is now the regular release. It works fine for me in 1.2.x

  9. Robert Berger Says:

    Is it my imagination or does routing_navigator get stuck in an infinite error of

    “too much recursion”

    if you are using prototype version 1.5.2_pre0 (latest prototype from svn)?

    Its happening that way for me…

    Thanks! (Great plugin. really helpful!)

  10. Robert Berger Says:

    Actually its failing the same way with Prototype 1.5.1.1 as well, and it does work fine with 1.5.0.

    Rob

Leave a Reply

I am a human (check this)

Remember: escape your underscores \_ and indent code at least 4 spaces or incur the wrath of smartypants.