Post and Get
在《Agile Web Development with Rails》中看到如下的一句話???? If it has no associated data, it will come in as a GET request. If instead it contains form data, we’ll see a POST. Inside a Rails controller, the request information is available in the attribute request. We can check the request type using the methods get?( ) and post?( ).
也就是說當(dāng)沒有數(shù)據(jù)的時候,是get,而有數(shù)據(jù)的時候則是post.
例如我們在用戶登錄的時候,首先轉(zhuǎn)到登錄界面,這個時候當(dāng)然還沒有數(shù)據(jù),那么

為true,輸入相應(yīng)的數(shù)據(jù),提交為false,這樣我們可以通過一個action來控制流程
?















posted on 2006-05-16 10:08 martin xus 閱讀(265) 評論(0) 編輯 收藏