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

  • SEARCH
  • Home
  • 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 5844865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:21:13+00:00 2026-05-22T12:21:13+00:00

I’m currently developing an application that needs to parse some (a big file of)

  • 0

I’m currently developing an application that needs to parse some (a big file of) csv data. I have to perform several steps to manipulate and map the data to ActiveRecord objects. This has to be done in several steps, and i have to display the results in a view.

So i start at imports#index. Here i let the users upload the csv file, nothing fancy

Then i go trough imports#create to create the import object.

Then i’m at step2 imports#show. Here i display the results. So in import#show i parsed all the csv data and delete the rows that i dont need. (It’s one big array with structs in it.)

Then i want to go to step 3 to manipulate the same data further. But how in the world can i get the big array from step2 in step3 without a session (because of the Structs i cant insert it in a session it gives me the following error: TypeError (can't dump anonymous class #<Class:0x105477128>):

And when i put it in a session with .inspect it raises this error: ActionDispatch::Cookies::CookieOverflow. But then it’s all one big string and i want to maintain the ruby functionality (e.g. it’s 1 big array with struct objects in it…)

So to wrap it all up

Step 1
upload file
Step2
parse data & manipulate it.
Step3
Use the data from step2 (without a session..)
Step4
User data from step3

How in the world can i get this to work… I can’t seem to figure it out :<

  • 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-05-22T12:21:14+00:00Added an answer on May 22, 2026 at 12:21 pm

    You should keep in mind different principles:

    • Controllers are not meant to deal with data, Models or Classes do

    • parsing a big file shouldn’t be made inside the controller but put inside some queue (Delayed Job handles this properly, see how it works here). Just imagine your user waiting endlessly for something to happen…

    To sum up:

    • Step 1: upload file => ok I guess you save it, great

    • Step2 parse data & manipulate it => should be triggered by step 1 and launched in a Delayed Job queue

    • Step3 Use the data from step2 (without a session..) => all data processed the way I suggest could be stored in cache, database or wherever you find it useful

    • Step4 User data from step3 => you want to display the result of your processing, I suggest you implement an AJAX request checking if the job was done or not (to do that, I highly recommend you store the info in cache in order not to query your database too often).

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have some data like this: 1 2 3 4 5 9 2 6
I want use html5's new tag to play a wav file (currently only supported
I have a JSP page retrieving data and when single or double quotes are
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.