开发者

Edit action of Checkout controller

开发者 https://www.devze.com 2023-03-03 09:24 出处:网络
I\'m looking in the source code of the Checkout controller (http开发者_StackOverflow中文版s://github.com/spree/spree/blob/0-60-stable/core/app/controllers/checkout_controller.rb) and didn\'t find the

I'm looking in the source code of the Checkout controller (http开发者_StackOverflow中文版s://github.com/spree/spree/blob/0-60-stable/core/app/controllers/checkout_controller.rb) and didn't find the edit action there. Where is it defined?


The CheckoutController has an implied edit action. There's no direct logic for edit itself.

There is however the before_filter :load_order which in turn triggers a before_[state] callback method, depending on which state the checkout is in.


There is no edit action in Spree::CheckoutController but it renders the checkout/edit.html.erb. Reference superclass action. Following reference from spree docs

The edit action renders the checkout/edit.html.erb template, which then renders a partial with the current state, such as app/views/spree/checkout/address.html.erb. This partial shows state-specific fields for the user to fill in. If you choose to customize the checkout flow to add a new state, you will need to create a new partial for this state.


Spree uses resource_controller gem - https://github.com/jamesgolick/resource_controller, so actions that are not defined in Spree code might be run in the resource_controller.

0

精彩评论

暂无评论...
验证码 换一张
取 消