![]() Thanks to anyone who responds in advance! Let me know if you want me to provide any more information to help diagnose the problem. I am still relatively new to Ruby on Rails, so I would not be surprised if it is a basic error, but it is not one that I am easily seeing. I am perplexed as to why this error is happening, as it seems like this basic test should work. A PDF is sent and I can "open" it, but the PDF fails to load and will not open in any PDF reader that I have tried, including Microsoft Edge's and Adobe Acrobat Reader. The server runs fine in development and there is no error in utilizing the button. Send_data("hello.pdf", filename: "hello.pdf", type: 'application/pdf') Post 'pages#download_report', action: :download_report, controller: 'pages'Īnd in the Pages controller, the download_report method is: def download_report It is routed to the appropriate controller: get 'pages#download_report' => 'pages#report_page' ![]() I set up a button that would download the PDF from a page: ![]() For this, I have grabbed the Prawn (version 2.2.2) gem. The same approach is taken with CSS bundlers that rely on Node. I have been using Ruby on Rails (version 5.2.1) with the RubyMine IDE for a project and am at a development stage in which I want to create some PDF-based reports. Whether you like esbuild (and who doesn’t these days) or rollup.js or even Webpack, you’ll be able to use any of them through the new jsbundling-rails integration that can be pre-configured for new apps with -javascript esbuild. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |