Ruby on Rails Saturday, May 1, 2010

Is it possible to put an if/else statemnt, and change the map.root
under each condition? for ex--

if current_user
map.root :controller => 'current_user'

else

map.root :controller => 'home'

end

cuase apparenlty that doesn't work, so is there an alternative way?
basically if the user is logged in, i dont want the homepage to be the
homepage anymore, but instead the user page.


NOTE:::: i can't do a redirect_to in my home controller, because i
have multiple cases (current_user, current_admin, etc) and i can't
have multiple redirects in an action.

so is there a way to change the homepage according to who's logged in?
Thanks


--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment