need to save generated pdf in public folder

hai im ruby on rails developer, im integrating princely plugin and prince software to my rails application

i have generated pdf file successfully using the following code princely = Princely.new()

      html_string = render_to_string(:template => 'test_methods/ visual_test/generate_report.rhtml', :layout=> false)

     send_data(        princely.pdf_from_string(html_string),       :filename => 'visual_test',       :type => 'application/pdf'      )

now i want to need save the pdf file in my public folder, i have tried so many types

but till now im not getting any result

please help me

thanks in advance

Ratnam Raju

send_data sends data backs to browser making the request. If you want to save data to a file on your server have a look at the File class.

Fred