Open
Conversation
Closed
There was a problem hiding this comment.
看到這邊覺得很困惑, 看起來 form 有設一個參數 quantity 1,2,3,4,5 給 user選
但是送出之後 看起來是會往 checkout_carts_path 丟過去
但是我去看 carts controller 裡面的 checkout action 裡面好像沒有處理選擇的數字...
實際上畫面操作的時候 看起來後台也是當作是 數量 1 在計算..
不知道是否是這邊尚未寫完? 因為寫作業時 這邊卡很久, 所以很想知道怎麼解決
thanks
There was a problem hiding this comment.
form_for 好像會依照給的path來決定是post(create)或patch(update)
是對著cart_item_path丟值的
可以在那頁按右鍵看原始碼,會看到patch
http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-form_for-label-Resource-oriented+style
<%= link_to cart_item_path(current_cart, item), :method => :delete do %>
似乎也沒有傳值,是在controller另外從session或cache要資料的
(有錯請指正XD)
✔ admin 的 order 列表應要能顯示訂單狀態 @done (14-06-20 01:56)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
官方第二次作業解答