首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails3子域路由

Rails3子域路由
EN

Stack Overflow用户
提问于 2010-10-04 11:04:08
回答 1查看 2.2K关注 0票数 2

我正在尝试通过我的Rails 2.3.5应用程序移植到Rails 3,但在以下路由配置方面遇到了问题:

代码语言:javascript
复制
 ActionController::Routing::Routes.draw do |map| 
     map.app  '', :controller => 'projects', :action => 'index', :conditions => {:subdomain => true}

      map.with_options :controller  => 'site', :action => 'page', :subdomain => false, :conditions => {:subdomain => false} do |site|
        site.site             '',        :path => 'index'
        site.pricing          'pricing', :path => 'pricing'
        site.tour             'tour',    :path => 'tour'
        site.about            'about',   :path => 'about'    
        site.contact          'contact', :path => 'contact'
        site.privacy          'privacy', :path => 'privacy'    
        site.terms            'terms',   :path => 'terms'
      end
    end

rails 2.3.5应用程序正在使用subdomain-fu作为子域条件...我如何在Rails 3中做到这一点?我想有两个空白的路线。如果存在子域,它会路由到应用程序,如果没有子域,它应该会路由到站点。

EN

回答 1

Stack Overflow用户

发布于 2010-10-04 19:24:39

只需详细了解railscast的子域问题即可。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3852595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档