Routing Error during “Ruby on Rails-Tutorial”

后端 未结 9 2005
忘了有多久
忘了有多久 2021-01-24 03:25

It seems like some people here had this problem but I couldn\'t find any solution in another topic.

I am doing Chapter 3 of the Ruby on Rails-Tutorial, working on the sta

9条回答
  •  天涯浪人
    2021-01-24 03:50

    your routes.rb file has problems, use either RESTful style:

    resource :static_pages do 
      collection do 
        get :home
        get :help
        get :about
      end 
    end
    

    or the non RESTful style:

    match "static_pages/home", :controller => "static_pages", :action => "home"
    match "static_pages/help", :controller => "static_pages", :action => "help"
    match "static_pages/about", :controller => "static_pages", :action => "about"
    

    for more details please refer to official guide: http://guides.rubyonrails.org/routing.html

提交回复
热议问题