I am trying to put a Rails link_to statement inside a Mailer email that includes the full-path (ie - http://localhost/contacts/id/confirm). The link_to statement that I am
Because mailers aren't run inside the response stack, they have no idea what host they were called from: that's why you're running into this error. It's easy to fix, change the code to include the host:
<%= link_to "here", :controller => "contacts", :action => "confirm",
:only_path => false, :id => 17, :host => "example.com" %>
You can also set the default host on a per-application basis inside of your application.rb (or any of your environments) by specifying this:
config.action_mailer.default_url_options = { :host => "example.com" }
For the full documentation on ActionMailer and why this problem occurs, check out the ActionMailer documentation.