title: How to fix UrlGenerationError Missing Required Key [:quid] error
body: <p>I'm trying to setup a payment process through stripe for teachers, which I called Mentor.</p>
  
  <p>The process consists of redirecting students, once they added card details in, to a page pickup where they would be able to download the content. For some reason it says that there is a key[:quid] missing.</p>
  
  <p>Here is my transaction controller:</p>
  
  <pre><code>class TransactionsController &lt; ApplicationController
  
  def create
      mentor =  Mentor.find_by!(slug: params[:slug])
      token = params[:stripeToken]
  
      begin
          charge = Stripe::Charge.create(
          :card   =&gt; token,
          :amount      =&gt; (mentor.price * 100).floor,
          :description =&gt; current_user.email,
          :currency    =&gt; 'gbp'
          )
  
          @sale = mentor.sales.create(email_user: current_user.email)
          redirect_to pickup_url(guid: @sale.guid)
  
      rescue Stripe::CardError =&gt; e
          @error = e
          redirect_to mentor_path(mentor), notice: @error
      end
  
  end
  
  def pickup
      @sale = Sale.find_by!(guid: params[:guid])
      @mentor = @sale.mentor
  end
  </code></pre>
  
  <p>end</p>
  
  <p>Here is the sale.rb:</p>
  
  <pre><code>class Sale &lt; ActiveRecord::Base
  before_create :generate_guid
  belongs_to :mentor
  
  private
      def generate_guid
          self.guid = SecureRandom.uuid()
      end
  end
  </code></pre>
  
  <p>An here is the summary of the error:</p>
  
  <p><a href="https://i.stack.imgur.com/oIbhj.png" rel="nofollow noreferrer">The error screenshot</a></p>