Rails 3 -Render PDF from view and attach to email
I have been using Wicked_pdf to render a view as a PDF and actionmailer to send emails, but I can't get them to work together. I want to attach a PDF version of a certain view to an email using actionmailer and send it out by clicking a link or a button. I have a link_to command that sends out an email. Here is my controller that gets the email generated: def sendemail @user = User.find(params[:id]) Sendpdf.send_report(@user).deliver redirect_to user_path(@user) flash[:notice] = 'Email has been sent!' end Here is what I have in my actionmailer: class Sendpdf < ActionMailer::Base default :from