This is my show controller for repair_tickets:
def show
@repair_ticket = RepairTicket.find(params[:id])
logger.debug(@rp_parts)
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @repair_ticket }
format.pdf do
send_data RepairTicketDrawer.draw(@repair_ticket), :filename =>
‘repair_tickets/@repair_ticket.id.pdf’, :type => ‘application/pdf’,
:disposition => ‘inline’
end
and this is my public class:
class RepairTicketDrawer
def self.draw(repair_ticket)
pdf = PDF::Writer.new
pdf.text “Test”
pdf.text (repair_ticket.client_id)
pdf.render
end
end
This line gices me problems:
pdf.text (repair_ticket.client_id)
I get:
NoMethodError in Repair ticketsController#show
undefined method `each’ for 1:Fixnum