Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8593533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:00:50+00:00 2026-06-12T00:00:50+00:00

I need to export a previously rendered table from my view to pdf. When

  • 0

I need to export a previously rendered table from my view to pdf. When I build the array of hashes as follows:

__index = 0

@people.each do |p| %>
  @pdfdata[__index] = {                                
    [:name] => p.name.to_s,                         
    [:surname] => p.surname.to_s
    __index += 1
  end
end 

and send it to the controller in order to export it on a pdf as follows:

hidden_field_tag(:pdfdata, @pdfdata)

when I get the params[:pdfdata] I cannot find a way unless I build a string parser to map the data accordingly… is there a better way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:00:51+00:00Added an answer on June 12, 2026 at 12:00 am

    Modifying your code a little bit to get

     @people.each_with_index do |p,i| %>
       @pdfdata[i] = {                                
        [:name] => p.name.to_s,                         
        [:surname] => p.surname.to_s}
      end 
    

    and use this gem to create the hidden has field

    https://github.com/brianhempel/hash_to_hidden_fields

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to export about 300,000 rows from a table on MS SQL server
I need to export data from several tables in SQL Server 2008 using SSMS.
I need to export some data from SAS to CSV, so that I can
I need to export a matrix of regression results from Stata to MATLAB. I
Do I really need to export the private key from my computer and pass
I need to export some numeric values from a given ASCII text file and
I am continuing from my previous question I need a way to export my
I need to export an SQLite database from an Android phone to a computer.
I need to export the Users List from excel to my asp.net mvc(C#) application.
I need to export data from a SQL database (some groups use SQL Server,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.