title: Rails: path in File.read
body: <p>In user_mailer.rb</p>
  
  <pre><code>def welcome_email(message)
  @message = message   
  @image=@message.pics_file_name  #Getting file name
  attachments['@image']=File.read('path/@image') #Have to get path here
  mail(:to =&gt; @message.mailto, :subject =&gt; 'Welcome to my site')
  end
  </code></pre>
  
  <p>I'm retrieving the file name from database.I have to use the file name in File.read() for sending file as attachment to a specified mail</p>