title: (Friendly_id) How to use slug instead of id in nested routes?
body: <p>I have two models - Team and Campaign.</p>
  
  <p>Team <code>has_many :campaigns</code> &amp; Campaign <code>belongs_to :team</code></p>
  
  <p>Using friend_id gem, I have my team routes working as expected i.e <a href="https://localhost/t/myteam" rel="nofollow noreferrer">https://localhost/t/myteam</a></p>
  
  <p>However, for <code>campaign_path(@campaign.team, @campaign)</code> my url shows up as <a href="http://localhost/t/1/campaign/1" rel="nofollow noreferrer">http://localhost/t/1/campaign/1</a> while I am expecting it to be <a href="http://localhost/t/myteam/campaign/1" rel="nofollow noreferrer">http://localhost/t/myteam/campaign/1</a></p>
  
  <p>How can I achieve this? What am I doing wrong?</p>
  
  <p>Sharing snippet of my routes code.</p>
  
  <pre><code>resources :teams, :path =&gt; 't' do
    member do
      get :new_invite
      resources :campaigns, :path =&gt; 'c' do
        member do
          get :share_callback
          get :enter
        end
      end
    end
  end
  </code></pre>
  
  <p>Campaign.rb</p>
  
  <pre><code>extend FriendlyId
  friendly_id :campaign_heading, use: :slugged
  belongs_to :team
  </code></pre>
  
  <p>Team.rb</p>
  
  <pre><code>extend FriendlyId
  friendly_id :slug, use: :slugged
  </code></pre>