5

我正在查看 Checkout 控制器的源代码(https://github.com/spree/spree/blob/0-60-stable/core/app/controllers/checkout_controller.rb)并没有找到编辑在那里行动。它在哪里定义?

4

3 回答 3

6

CheckoutController 具有隐含的编辑操作。编辑本身没有直接的逻辑。

然而,有 before_filter :load_order 反过来触发 before_[state] 回调方法,具体取决于结帐处于哪个状态。

于 2011-06-19T19:21:57.720 回答
1

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.

于 2016-03-05T16:48:44.637 回答
0

Spree 使用 resource_controller gem - https://github.com/jamesgolick/resource_controller,因此 Spree 代码中未定义的操作可能会在 resource_controller 中运行。

于 2011-05-22T15:08:34.990 回答