undefined local variable or method `root_path' Hartl's Tutorial Chapter 5.3.2

前端 未结 7 1662
长情又很酷
长情又很酷 2021-01-04 05:12

So my first question on Stackoverflow..... =]

My tests in Chapter 5.3.2 of Michael Hartl\'s RoR Tutorial are all failing, when the tutorial says it should be passing

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-04 05:47

      root :to => 'static_pages#home' 
      match '/help',    to: 'static_pages#help',    via: 'get'
      match '/about',   to: 'static_pages#about',   via: 'get'
      match '/contact', to: 'static_pages#contact', via: 'get'
    

    works for me

    test results: 9 examples 0 failures

    urls seem to have changed like this now:

    http://localhost:3000/about
    

提交回复
热议问题