title: Load Vendor Object By Name Parameter Extracted From The URL
body: <p>I'm trying to create a route that link to the store page of each <a href="https://github.com/spree-contrib/spree_multi_vendor/blob/master/app/models/spree/vendor.rb" rel="nofollow noreferrer">Vendor</a> using <a href="https://github.com/spree/spree" rel="nofollow noreferrer">Spree Commerce</a>. The page should list the details (name, about us, etc), and the products of the given vendor.</p>
  
  <pre><code>https://example.com/stores/vendor-one
  </code></pre>
  
  <p>My <strong><em>routes.rb</em></strong> configuration :</p>
  
  <pre><code>Spree::Core::Engine.routes.draw do
      resources :stores
  end
  </code></pre>
  
  <p>My <strong><em>stores_controller</em></strong> controller :</p>
  
  <pre><code>module Spree
      class StoresController &lt; Spree::StoreController  
        require 'vendor'
        def show
          @vendor = current_spree_vendor
        end     
      end
  end
  </code></pre>
  
  <p>My <strong><em>show.html.erb</em></strong> template :</p>
  
  <pre><code>&lt;h2&gt;&lt;%= @vendor.name %&gt;&lt;/h2&gt;
  &lt;p&gt;&lt;%= @vendor.about_us %&gt;&lt;/p&gt;
  </code></pre>
  
  <p>The error that I'm getting :</p>
  
  <blockquote>
    <p>NoMethodError in Spree::Stores#single</p>
    
    <p>Showing /myapp/app/views/spree/stores/show.html.erb where line #2 raised:</p>
    
    <p>undefined method `name' for nil:NilClass</p>
    
    <p>Line # 2 : <code>&lt;h2&gt;&lt;%= @vendor.name %&gt;&lt;/h2&gt;</code></p>
  </blockquote>
  
  <p>How can I load the given <a href="https://github.com/spree-contrib/spree_multi_vendor/blob/master/app/models/spree/vendor.rb" rel="nofollow noreferrer"><strong>Vendor</strong></a> by getting its name from the url ? I'm new to Rails so any help will be highly appreciated !</p>