title: How to include full-path in Rails 3 link_to statement?
body: <p>I am trying to put a Rails link_to statement inside a Mailer email that includes the full-path (ie - <a href="http://localhost/contacts/id/confirm">http://localhost/contacts/id/confirm</a>).  The link_to statement that I am trying works in my standard View in /pages/options, but not in the Mailer email.</p>
  
  <p>Here is my /pages/options Controller code:</p>
  
  <pre><code>class PagesController &lt; ApplicationController
      def options
      end
  end
  </code></pre>
  
  <p>And here's the pages/options View:</p>
  
  <pre><code>&lt;div&gt;
      &lt;%= link_to "here", :controller =&gt; "contacts", :action =&gt; "confirm", 
      :only_path =&gt; false, :id =&gt; 17 %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I put this link into the following mailer (welcome_email.html.rb), I am getting the error below.  Any help with this will be greatly appreciated.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;%= link_to "here", :controller =&gt; "contacts", :action =&gt; "confirm",
       :only_path =&gt; false, :id =&gt; 17 %&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The error message:</p>
  
  <pre><code>RuntimeError in Contacts#create
  
  Showing C:/Documents and Settings/Corey Quillen/My Documents/Dev/Dev    
  Projects/my_project
  Project/my_project/app/views/user_mailer/welcome_email.html.erb where line #7  
  raised:
  
  Missing host to link to! Please provide :host parameter or set  
  default_url_options[:host]
  Extracted source (around line #7):
  
  4:     &lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt;
  5:   &lt;/head&gt;
  6:   &lt;body&gt;
  7:     &lt;%= link_to "here", :controller =&gt; "contacts", :action =&gt; "confirm", :only_path    
  =&gt; false, :id =&gt; 17 %&gt;
  8:   &lt;/body&gt;
  9: &lt;/html&gt;
  </code></pre>