ruby - Cannot find image file to attach using ActionMailer on Rails 4 -


i trying attach image email using actionmailer on rails 4. in /app folder, have mailer called 'usermailer.' here code in mailer:

def welcome_email(user)      @user = user     @url = 'http://www.powerproject.com'     attachments["powerpuff-girls.jpg"] = file.read('powerproject/app/assets/images/powerpuff-girls.jpg')      mail(to: @user.email, subject: "welcome power project!", reply_to: "powerprjct@gmail.com") end 

the mailer works fine when attachment line omitted. however, when run code, error "no such file or directory." image file stored in app/assets/images.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -