Class: Spree::ProductsController
- Inherits:
-
StoreController
- Object
- ApplicationController
- BaseController
- StoreController
- Spree::ProductsController
- Defined in:
- app/controllers/spree/products_controller.rb
Instance Method Summary collapse
Methods inherited from StoreController
Methods included from Core::ControllerHelpers::Order
#after_save_new_order, #associate_user, #before_save_new_order, #current_order, included, #set_current_order
Methods included from Core::ControllerHelpers::Common
Methods included from Core::ControllerHelpers::Auth
#current_ability, included, #redirect_back_or_default, #store_location, #try_spree_current_user, #unauthorized
Instance Method Details
#index ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/controllers/spree/products_controller.rb', line 9 def index @searcher = Config.searcher_class.new(params) @searcher.current_user = try_spree_current_user @searcher.current_currency = current_currency @products = @searcher.retrieve_products respond_with(@products) end |
#show ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/spree/products_controller.rb', line 17 def show return unless @product @variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images]) @product_properties = @product.product_properties.includes(:property) referer = request.env['HTTP_REFERER'] if referer begin referer_path = URI.parse(request.env['HTTP_REFERER']).path # Fix for #2249 rescue URI::InvalidURIError # Do nothing else if referer_path && referer_path.match(/\/t\/(.*)/) @taxon = Taxon.find_by_permalink($1) end end end respond_with(@product) end |