Thank you for your response Greg.  I found that I was making my code 
progressively worse by trying to do the conditional routing in routes.rb 
file.  Instead, I decided to do it the old-fashioned way as shown below:

        <div id="main-navigation">
          <% if authorize_admin? %>
            <%= navigation [:prospects,{:admin => {:controller => 
'admin', :action => 'index'}}] %>
          <% else %>
            <%= navigation [{:welcome => root_path}] %>
          <% end %>
          <div class="clear"></div>
        </div>

This is a snippet of code from my application.html.erb file.  I will 
most likely refactor it later to create the navigation array in the 
application_helper.rb once things settle down.

By the way, I tried what you suggest above.  I required the file as you 
had outlined and then included it since it is a module but that resulted 
in a chain of errors since it requires a slew of other things to be 
loaded as well.

Regards,

Bharat
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to