title: Can't get id of related model/
body: <p>I need to get the id of a <code>patient</code> in the <code>reports</code> controller. Each <code>user</code> has <code>patients</code>, while each <code>patient</code> can have <code>reports</code> created by the doctor.</p>
  
  <p>I am getting this error:</p>
  
  <blockquote>
    <p>ActiveRecord::RecordNotFound in ReportsController#new
    Couldn't find Patient with 'id'=
    Extracted source (around line #49): </p>
  </blockquote>
  
  <p>Patient Show Page, link to new report:</p>
  
  <pre><code>&lt;% if signed_in? %&gt;
    &lt;% if @patient.id == current_user.id %&gt;
      &lt;%= link_to "Add Visit Report", new_report_path(@patient),class: "button_one" %&gt;
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Reports Controller:</p>
  
  <pre><code>def new
    @report = Report.new 
  end
  
  private
  
  def report_params
    params.require(:report).permit(:date, :report)
  end
  
  def find_patient
    @patient = Patient.find(params[:patient_id])  //Line 49 where error is
  end
  
  def find_report
    @report = Report.find(params[:id])
  end
  </code></pre>
  
  <p>User, Patient and Report models:</p>
  
  <pre><code>class Patient &lt; ActiveRecord::Base
  
    include Tire::Model::Search
    include Tire::Model::Callbacks
  
    validates :name, presence:true
    validates :age, presence:true
    validates :phone, presence:true
    validates :ailment, presence:true
    validates :apointment, presence:true
    validates :status, presence:true
  
    belongs_to :user
    has_many :reports, dependent: :destroy
  
    def to_s
      name
    end
  end
  
  class Report &lt; ActiveRecord::Base
    belongs_to :user
    belongs_to :patient
  end
  
  class User &lt; ActiveRecord::Base
    include Clearance::User
  
    has_many :patients
    has_many :reports, dependent: :destroy
  end
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>       reports GET    /reports(.:format)                      reports#index
                 POST   /reports(.:format)                      reports#create
      new_report GET    /reports/new(.:format)                  reports#new
     edit_report GET    /reports/:id/edit(.:format)             reports#edit
          report GET    /reports/:id(.:format)                  reports#show
                 PATCH  /reports/:id(.:format)                  reports#update
                 PUT    /reports/:id(.:format)                  reports#update
                 DELETE /reports/:id(.:format)                  reports#destroy
  </code></pre>