On Wed, Apr 1, 2009 at 1:24 PM, Bharat Ruparel
<[email protected]> wrote:
>
> I am trying to setup role based routing in my application.  Something
> similar to the following:
>
>  map.root :controller => (authorize_admin? ? 'prospects' : 'welcome')
>
> I am getting an error that authorize_admin? is not defined.

Require the file from your lib dir, something like:

require "#{ RAILS_ROOT }/lib/foo.rb"


> It is
> defined under lib directory and I can successfully call it from other
> places in the application.  How do you set up conditional root routes
> for an application?





-- 
Greg Donald
http://destiney.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