title: How to construct links to static images?
body: <p>I realized that when I send mails(letters) on localhost site via local postfix server, they were sent successfully, but each time I need to include the letter link to my logo stored in: </p>
  
  <blockquote>
    <p>public/castle.jpg</p>
  </blockquote>
  
  <p>app/mailers/<strong>review_mailer</strong>.rb:</p>
  
  <pre><code>class ReviewMailer &lt; ApplicationMailer
    default from: 'no-reply@kalinin.ru'
  
    def welcome_email(review)
      @review = review
      mail(to: 'bla@bla.ru', subject: 'New review create')
    end  
  end
  </code></pre>
  
  <p>views/review_mailer/<strong>welcome_email</strong>.html.erb:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    ...........................
      &lt;p&gt;logo: &lt;%= image_tag 'public/castle.jpg' %&gt;&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>application.rb:</p>
  
  <pre><code>config.action_mailer.default_url_options = { host: 'localhost' }
  </code></pre>
  
  <p>development.rb:</p>
  
  <pre><code>  config.action_mailer.raise_delivery_errors = false
    config.action_mailer.delivery_method = :sendmail
    config.action_mailer.default_url_options = { :host =&gt; 'localhost:3000' }
  </code></pre>
  
  <p>reviews_controller:</p>
  
  <pre><code>  def create
      @review = current_user.reviews.build(review_params)
      if @review.save
        ReviewMailer.welcome_email(@review).deliver_now
        redirect_to root_path
    end
  </code></pre>
  
  <p>after creating a new review, here is the <strong>console output</strong>:</p>
  
  <pre><code>ReviewMailer#welcome_email: processed outbound mail in 205.9ms
  
  Sent mail to bla@bla.ru (73.5ms)
  Date: Tue, 22 Sep 2015 12:47:11 +0300
  From: no-reply@kalinin.ru
  To: prozaik81-2@yandex.ru
  Message-ID: &lt;5601239fdd0d3_18b43f823a7394382836b@kalinin.mail&gt;
  Subject: New review create
  Mime-Version: 1.0
  Content-Type: multipart/alternative;
   boundary="--==_mimepart_5601239fdbc22_18b43f823a73943828272";
   charset=UTF-8
  Content-Transfer-Encoding: 7bit
  
  ----==_mimepart_5601239fdbc22_18b43f823a73943828272
  Content-Type: text/html;
   charset=UTF-8
  Content-Transfer-Encoding: 7bit
  
  &lt;html&gt;
    &lt;body&gt;
      &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  ....................
      &lt;p&gt;logo: &lt;img src="/images/public/castle.jpg" alt="Castle" /&gt;&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  
  ----==_mimepart_5601239fdbc22_18b43f823a73943828272--
  
  Redirected to http://localhost:3000/
  Completed 302 Found in 601ms (ActiveRecord: 301.4ms)
  </code></pre>
  
  <p>Mail(letter) is not being sent, what can possibly be wrong?</p>