2010-12-01 46 views

回答

0

設置你的根路徑引導人們在那裏(這些都是Rails的3條路線):

在配置/routes.rb中

root "content#features" 

在app /控制器/ contents_controller.rb

class ContentsController < ApplicationController 
    def features 
    end 
end 

但是,這不會做重定向。要做到這一點,你需要這樣的事: 在配置/routes.rb中

match "features" => "contents#features", :as => "features" 
root "content#index" 

在app /控制器/ contents_controller.rb

class ContentsController < ApplicationController 
    def index 
    redirect_to features_url 
    end 
    def features 

    end 
end