Topic: Navigation ideas.

I started with a simple application to store server information and relate it to primary contacts.  Since then I've had massive scope creep.  I'm using a left navigation menu, but now that there are many items, I need a better navigation system.  I've been thinking of different ways to do this, but I'd like some outside input.

Any ideas?

Here's the menu:

  Unix Servers
  Windows Servers
  Retired Servers
  ALL Servers
  ALL Servers (Detailed)
    New Server
  New Project
  New Person
  New Team
Operating Systems
  New OS
Patch Bundles
  New Patch Bundle
Server Models
  New Server Model
Support Contracts
  New Contract
  New Environment
  New Location
Data Center Racks
  Operations Report
  Hostinfo Files
External Links:
  APC Rack Configurator
  Firewall Rule Request
  Centralized Syslog
  Sun EOSL Matrix



Re: Navigation ideas.

I see two options here:

1) Make your vertical navigation collapsible:

> Servers                     v Server
> Projects        ==>                 Unix Servers
> People                              Windows Servers
> Teams                               Retired Servers
...                                   ALL Servers
                                      ALL Servers (Detailed)
                                      New Server
                              > Projects
                              > People

2) Change your design to tabs with a navigation submenu:
 ________  ________  ______  _____
/Servers \/Projects\/People\/Teams\ ...
Unix  Retired  Windows  Summary  Detail  New

Re: Navigation ideas.

Thanks rubinelli.  I think I'm going to go with the tabs.

Now I'm creating the sub menus in application.html.erb like so:

<% if (controller.controller_name == "people") %>
         <%= link_to_unless_current "People", people_path() %>
         <%= link_to_unless_current "New Person", new_person_path() %>

Is there a better way to implement this technically?


Re: Navigation ideas.

I'll show you an option that would be a bit DRYer, though I'm sure more experienced Railers can come up with even better alternatives. You can create a method in your controllers to return a list of link texts and paths, like this:

def navlinks
  [{:text => 'People', :path => people_path},
  {:text => 'New Person', :path => new_person_path}]

This way, you remove the ifs from your layout, and it looks like this:
<% navlinks.each do |link| %>
  <%= link_to_unless_current link[:text], link[:path]%>
<% end %>