title: Contact Form for User Profile
body: <p>I been struggling of thinking of a way to complete this function. </p>
  
  <p>Currently I have a user with a profile. And a general Contact form model that is table-less and doesn't save anything to the database.</p>
  
  <p>My goal is to have a general contact form, In which I can link a contact button on a individual user profile. That contact form when submitted will be sent to the user email specified in the profile attribute. So for example the profile has a field t.string contact_email. </p>
  
  <p>Currently I have the contact model set up where it can send to one individual email. Mainly the app owner. </p>
  
  <pre><code>   class ContactMailer &lt; ApplicationMailer
  
        default :to =&gt; "stephen@example.com"
  
         def contact_me(msg)
           @msg = msg
  
        mail from: @msg.email, subject: @msg.subject, body: @msg.content
       end
      end
  </code></pre>
  
  <p>My goal is to simply link the </p>
  
  <pre><code>        default :to =&gt; "stephen@example.com"
  </code></pre>
  
  <p>to something like </p>
  
  <pre><code>         default :to =&gt; "@profile.contact_email"
  </code></pre>
  
  <p>I have no idea how to specify the user for the form or if its  possible. The process would have to include once the visitor hits contact us the form takes the profile email and uses it as the recipient.</p>
  
  <p>Sorry if this seems like I brung nothing to table to answering I'm just looking for a tip on maybe where to start or how it could be done.</p>