2

これは私のローカルでは機能するようですが、私のプロダクションでは機能しません。

nilエラーの数字 4 は、どの分類群のリンクでも 4 であるため、おそらく戻ってくることを示しています。

に何を調べることができるか知っている人はいますか?

このリンクをクリックしました:

<a href="/t/shirts/">Shirts</a>

私のエラー

ActiveRecord::RecordNotFound (Couldn't find Taxon with ID=4):

私のルート

match '/t/*id' => 'taxons#show', :as => :nested_taxons

#produces this line
nested_taxons   /t/*id(.:format)   {:controller=>"taxons", :action=>"show"}

分類群の管理者

class TaxonsController < Spree::BaseController
  #prepend_before_filter :reject_unknown_object, :only => [:show]
  before_filter :load_data, :only => :show
  resource_controller
  actions :show
  helper :products

  private
  def load_data
    @taxon ||= object
    params[:taxon] = @taxon.id
    @searcher = Spree::Config.searcher_class.new(params)
    @products = @searcher.retrieve_products
  end

  def object
    @object ||= end_of_association_chain.find_by_permalink(params[:id] + "/")
  end

  def accurate_title
    @taxon ? @taxon.name : nil
  end
end
4

1 に答える 1