5

I'm looking in the source code of the Checkout controller (https://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?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
trivektor
  • 5,608
  • 9
  • 37
  • 53

3 Answers3

6

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.

Cluster
  • 5,457
  • 1
  • 25
  • 36
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.

shiva kumar
  • 11,294
  • 4
  • 23
  • 28
0

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.

Priidik Vaikla
  • 744
  • 4
  • 13