Hi all I made a pdf file in ruby and to display it used the method send_data like # send_data pdf.render, :filename => "Hello.pdf",:type => "application/pdf" # Now I want to open it in another window or as a popup. How can I achieve it? Thanks to all. Sainaba. -- Posted via http://www.ruby-forum.com/.
just make the view do a request of the action in a popup? sainaba sainu wrote:> Hi all > > I made a pdf file in ruby and to display it used the method send_data > like > > # > send_data pdf.render, :filename => "Hello.pdf",:type => > "application/pdf" > # > > Now I want to open it in another window or as a popup. How can I achieve > it? > > Thanks to all. > > Sainaba. > >
Abdur-Rahman Advany wrote:> just make the view do a request of the action in a popup?Hi, Thanks for the comment. But I am rendering the pdf file directly from the controller. Then how can I do it? Can I open it using javascript ? or using any another method like send_data? Thanks. Sainaba -- Posted via http://www.ruby-forum.com/.
Does anyone know how to open a pdf file in a new window? - Cannot read file myfile.pdf Im trying this in my controller # controller def view_pdf send_data pdf.render, :filename => "myfile.pdf",:type => "application/pdf" end # application_helper.rb def popup_pdf link_to "PDF", { :action => ''view_pdf'' }, :popup => [''new_window'', ''height=300,width=600''] end Any ideas? -- Posted via http://www.ruby-forum.com/.
Fix it, wrong folder :) def view_pdf send_file "public/myfile.pdf" end Rath wrote:> Does anyone know how to open a pdf file in a new window? > - Cannot read file myfile.pdf > > Im trying this in my controller > # controller > def view_pdf > send_data pdf.render, :filename => "myfile.pdf",:type => > "application/pdf" > end > > # application_helper.rb > def popup_pdf > link_to "PDF", > { :action => ''view_pdf'' }, > :popup => [''new_window'', ''height=300,width=600''] > end > > Any ideas?-- Posted via http://www.ruby-forum.com/.