[英]What's the difference between “root to:” and “root ” in rails?
例子:
root 'post#index'
root :to => 'post#index'
我試圖了解差異,或者每個功能之間是否存在任何差異。 它完成相同的任務嗎?
這只是一個捷徑
https://guides.rubyonrails.org/routing.html#using-root
root to: 'pages#main'
root 'pages#main' # shortcut for the above
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.