首先,举一个我想做的事情的例子:
- If you go to http://www.meetup.com and you are not signed in, you see a page that shows Do something • Learn something... etc. which is a public page
- But when you are logged in, that same page (URL) shows Welcome, xxx...Whats happening... etc. which is specific to you.
That is what I m trying to do in my app as well.
如何在Rails2.3.8中做到这一点?
到目前为止,我已经:
- An
AboutsController
intended to serve up semi-static pages (wish the About wasn t plural!) - Root route is
map.root => :controller => "about"
.
现在,当未登录的用户转到时http://www.abc.com
,他将获得视图关于/index
的内容。到目前为止还不错。
但是,当用户登录时,我希望产品/索引
视图应显示为相同的URL,即http://www.example.com
URL(而不是http://www.example.com/products
)
这在Rails 2.3.8中可能吗?