Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Active Admin view to PDF

Tags:

I'm starting to develop in Ruby on Rails recently, therefore I consider myself beginner.

I'm testing the Active Admin gem ( http://activeadmin.info/ ) and I found a problem when export a view to PDF.

In the official documentation says how to customize the download links (http://activeadmin.info/docs/3-index-pages.html, it is at the end of the document) but does not work for me.

When I put the following line of code:

Mymodel ActiveAdmin.register do
  index: download_links => [: pdf]
end

The result is a link to localhost:3000/admin/mymodel.pdf and the following error displays: "Failed to load PDF document".

two questions:

  1. What do you suggest?
  2. Could you give an example?

I would be very grateful.