That helper is actually included into a subclass of Spree::BaseController,
called Spree::StoreController;

The reason for this is because Spree::BaseController is the absolute bare
necessity for Spree's controllers, and Spree::StoreController adds a couple
of extra things for the controllers that need that.

You'll probably want to use Spree::StoreController.

On Wed, Oct 9, 2013 at 4:08 AM, Tim Case wrote:

Hi Spree, I'm working with Spree 2.1.1 and I thought this was odd:

2.0.0p247 :001 > s =
=> #<Spree::BaseController:0x007fea498ecbb0 @_routes=nil,
@_action_has_layout=true, @_headers={"Content-Type"=>"text/html"},
@_status=200, @_request=nil, @_response=nil>
*2.0.0p247 :002 > s.respond_to?(:current_order) #=> false*
2.0.0p247 :001 > Spree::BaseController.class_eval do
include Spree::Core::ControllerHelpers::Order

2.0.0p247 :004 > s =
=> #<Spree::BaseController:0x007fea4a88eeb0 @_routes=nil,
@_action_has_layout=true, @_headers={"Content-Type"=>"text/html"},
@_status=200, @_request=nil, @_response=nil>
*2.0.0p247 :005 > s.respond_to?(:current_order) #=> true*

Is there a reason why this isn't being included? Am I missing the idea
behind including these helpers which seem to me should be part of the
controller in all occasions?


Ryan Bigg
Community Manager
Spree Commerce, Inc.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupspree-user @
postedOct 8, '13 at 5:08p
activeOct 8, '13 at 11:10p

2 users in discussion

Ryan Bigg: 1 post Tim Case: 1 post



site design / logo © 2022 Grokbase