Discussion Forums
- Topic List
- Most Recent Posts
- Sign In for more options
Hi all, I generated pdf file using prawn gem and prawnto gem .All working fine when i take
def show @attendence= Attendence.find(:all) end
but when i take
def show @attendence= Attendence.find(:all,:conditions => ["date >= ? AND date = ? AND date 'att.pdf', :type => 'application/pdf', :disposition => 'inline'
end
end
end
Running as: http://localhost:3000/attendence_report/att.pdf. please help me.
It dont make sense, @attendence from find.all or from find(:conditions) should be similar, a name value pair variable, only with different values.
Are you sure your find with conditions is returning values? I would print that out to make sure. Sometimes the silly simple thing is the answer.
Hi i changed code according to railscasts(prawn with pdfs).But still not working. Here is my code:
controller:attendence_report
def show
@attendence= Attendence.find(:all,:conditions => ["date >= ? AND date { 0 => :left, 1 => :right, 2 => :right, 3 => :right }
pdf.move_down(10)
When in index page i have startdate,enddate and grade selection. but i select these goes to show page and displays values then i have link to pdf.when i click link giving this error:
data must be a non-empty, non-nil, two dimensional array of Prawn::Cells or strings at pdf.table attendences. I removed table and verfied with pdf.text nothing is diaplying.please help anything wrong in passing variable to pdf.please help me
I would try the following.
instead of outputing the first_name try the count
@attendence= Attendence.find(:all,:conditions => ["date >= ? AND date
end
Thanks Tim It worked.
