What is the replacement for ActionController::Base.relative_url_root?

后端 未结 3 448
说谎
说谎 2020-11-28 08:35

I am porting a 2.x rails app to rails3; we\'ll call it foo-app. Foo-app is one section of a larger rails app and lives at main_rails_app.com/foo-app. Previously we just set

3条回答
  •  春和景丽
    2020-11-28 09:16

    You should be able to handle all that within the routes.rb file. Wrap all your current routes in scope; for instance.

    scope "/context_root" do
       resources :controller
       resources :another_controller
       match 'welcome/', :to => "welcome#index"
       root :to => "welcome#index"
    end
    

    You can then verify your routing via the rake routes they should show your routes accordingly, including your context root(relative_url_root)

提交回复
热议问题