Sha256: f6e177ecdcb230f1ba8aa4aaf5f544c2372fa11cd193bdbae7ca14956a02e6a2

Contents?: true

Size: 613 Bytes

Versions: 5

Compression:

Stored size: 613 Bytes

Contents

module Spree
  class TaxonsController < Spree::StoreController
    rescue_from ActiveRecord::RecordNotFound, with: :render_404
    helper 'spree/products'

    respond_to :html

    def show
      @taxon = Spree::Taxon.find_by_permalink!(params[:id])
      return unless @taxon

      @searcher = build_searcher(params.merge(taxon: @taxon.id, include_images: true))
      @products = @searcher.retrieve_products
      @taxonomies = Spree::Taxonomy.includes(root: :children)
    end

    private

    def accurate_title
      if @taxon
        @taxon.seo_title
      else
        super
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_frontend-2.2.2 app/controllers/spree/taxons_controller.rb
solidus_frontend-2.2.1 app/controllers/spree/taxons_controller.rb
solidus_frontend-2.2.0 app/controllers/spree/taxons_controller.rb
solidus_frontend-2.2.0.rc1 app/controllers/spree/taxons_controller.rb
solidus_frontend-2.2.0.beta1 app/controllers/spree/taxons_controller.rb