首页 > 数据库 > Oracle > MVC in Ruby on Rails

這張圖示中的執行步驟是:
其中,路由主要是根據HTTP Method方法(GET、POST或是PUT、DELETE等)以及網址來決定派往到哪一個Controller的Action。例如,我們在「Rails起步走」一章中的get "welcome/say_hello" => "welcome#say"意思就是,將GET welcome/say_hello的這個HTTP request請求,派往到welcome controller的say action。
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

index 动作;index 动作向 User 模型获取所有的用户(User.all);@users 变量,然后传递给 index 的视图;

References:
http://ihower.tw/rails3/basic.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26687597/viewspace-1207407/ ,如需转载,请注明出处,否则将追究法律责任。