-
Notifications
You must be signed in to change notification settings - Fork 19
Store v2 solution #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: store-v2-class
Are you sure you want to change the base?
Conversation
|
||
</td> | ||
|
||
<td> <%= link_to cart_item_path(current_cart, item), :method => :delete do %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看到這邊覺得很困惑, 看起來 form 有設一個參數 quantity 1,2,3,4,5 給 user選
但是送出之後 看起來是會往 checkout_carts_path 丟過去
但是我去看 carts controller 裡面的 checkout action 裡面好像沒有處理選擇的數字...
實際上畫面操作的時候 看起來後台也是當作是 數量 1 在計算..
不知道是否是這邊尚未寫完? 因為寫作業時 這邊卡很久, 所以很想知道怎麼解決
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
官方第二次作業解答