I have WickedPDF working in my application and am trying to add the PDF as an attachment. I have seen the following SO question Rails 3 -Render PDF from view and attach to email and was following the answer from Unixmonkey. I have the following set up:
Controller
def overtime
@hospital_bookings = HospitalBooking.scoped
hospital_booking = @hospital_bookings
@user = User.find(params[:id])
I believe the above should work according to the SO question. However I am getting ActiveRecrod::RecordNotFound - Couldn't find User without an ID
.
Updates
routes
`get "overtime" => "hospital_bookings#overtime", :as => "overtime" `