understanding rails routes: match vs root in routes.rb

后端 未结 3 988
耶瑟儿~
耶瑟儿~ 2020-12-05 11:42

i am following a rails tutorial from this link: http://ruby.railstutorial.org/chapters/filling-in-the-layout#code:static_page_routes

in the /config/routes.rb file, i

3条回答
  •  心在旅途
    2020-12-05 12:15

    root :to => 'pages#home'
    

    The url / will be mapped to pagescontroller home action.

    /something will be the url mapping for the pagescontroller's something action

提交回复
热议问题