title: set up helper_method :current_patient Rails 4
body: <p>How can I set a helper method in my app that when I call it, recognizes a current_patient from a certain medic (can be multiple medics, and multiple patients for a medic) and access to patient :id, this would help me to associate:</p>
  
  <p>Medic with a Patient with a Consultations for current_patient</p>
  
  <p>I need to access on a patient and set id (patient) on a Consultation table foreign key :patient_id </p>
  
  <p>in my create action in the controller I have:</p>
  
  <pre><code>def create
    @consultation = Consultation.new(consultation_params.merge({:patient_id =&gt; current_patient}))
    respond_to ...
  end
  </code></pre>
  
  <p>Is a helper method a good way to do this?</p>
  
  <p>How can I do this?</p>
  
  <p>my models:</p>
  
  <pre><code>class Medic &lt; ActiveRecord::Base
    has_many :patients
  end
  
  class Patient &lt; ActiveRecord::Base
    belongs_to :medic, :foreign_key =&gt; :medic_id
    has_many :consultations
    accepts_nested_attributes_for :consultations
  end
  
  class Consultation &lt; ActiveRecord::Base
    belongs_to :patient, :foreign_key =&gt; :patient_id
  end
  </code></pre>
  
  <p>Thanks for help</p>