Getting permission denied error when downloading a html page as html

38 Views Asked by At

This is my shortlisted action and shortlisted.html.erb , when clicked on download the list of shortlisted candidates should get downloaded.

def shortlisted
 ids= AppliedJob.shortlisted.pluck(:user_id)
 @shortlisted=User.where(id:ids)
 respond_to do |format|
   format.html
   format.pdf do
    render pdf: "file_name",
               template: 'users/shortlisted',
               layout: 'pdf.html.erb',
               page_size: 'A4',
               disposition: 'attachment',
               formats: [:html]
   end
 end
end

shortlisted.html.erb

<%= link_to "download", shortlisted_path(format: :pdf)  %>

This is what I am getting when trying to download

0

There are 0 best solutions below