Hello guys,
I have a problem with saving the pdf....
This is my controller code -------------------
def getpdf
pdf = PDF::Writer.new
@room_event = RoomEvent.find(:all)
@table=PDF::SimpleTable.new
@table.column_order = RoomEvent.column_names
data = []
@room_event.each do |room_event|
data.push({"name" => room_event.name,
"description" =>
room_event.description, "id" => room_event.id})
end
@table.data.replace data
@table.render_on(pdf)
pdf.save_as("public/pdf/hello.pdf")
end
There is one more file called getpdf.rpdf in which i havnt put any
code...
and there is a link in a some other rhtml file which calls this getpdf
action.
<%= link_to "get pdf", :action => "getpdf" %>
Now when i click on that link "get pdf" it asks me where to save this
file. and also it saves the file in pdf folder. but i just want it to
save in that pdf folder and doesnt want it to ask me explicitly.
Can anyone suggest me any ideas how can i do this... i am very new to
these concepts....
Can anyone help??
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---