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 785351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:51:49+00:00 2026-05-14T20:51:49+00:00

I am creating a small rails app for personal use and would like to

  • 0

I am creating a small rails app for personal use and would like to be able to upload excel files to later be validated and added to the database. I had this working previously with csv files, but this has since become impractical.

Does anyone know of a tutorial for using the roo or spreadsheet gem to upload the file, display the contents to the user and then add to the database (after validating)? I know this is quite specific, but I want to work through this step by step.

All I have so far is an ‘import’ view:

<% form_for :dump, :url=>{:controller=>"students", :action=>"student_import"}, :html => { :multipart => true } do |f| -%>
    Select an Excel File :
    <%= f.file_field :excel_file -%>
    <%= submit_tag 'Submit' -%>
<% end -%>

But have no idea how to access this uploaded file in the controller.

Any suggestions/help would be welcomed.
Thanks

  • 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-14T20:51:50+00:00Added an answer on May 14, 2026 at 8:51 pm
    • https://rubygems.org/gems/spreadsheet
    • https://github.com/zdavatz/spreadsheet/blob/master/GUIDE.md

    “The Spreadsheet Library is designed to read and write Spreadsheet Documents. As of version 0.6.0, only Microsoft Excel compatible spreadsheets are supported. Spreadsheet is a combination/complete rewrite of the Spreadsheet::Excel Library by Daniel J. Berger and the ParseExcel Library by Hannes Wyss. Spreadsheet can read, write and modify Spreadsheet Documents.”

    EDIT
    To get the uploaded file you have two options:
    1. (recommended) Use something a file upload plugin like paperclip and it will handle the bits and bolts.
    2. use the IO object params[:dump][:excel_file] as per: http://guides.rails.info/form_helpers.html#what-gets-uploaded

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

Sidebar

Related Questions

I'm creating a small app in ASP.NET MVC that generates ics (iCal) files based
I'm creating a site using a small Ruby framework, Sinatra, but I would like
I am creating a small backup script for my personal use, and it works
Rails newbie here struggling with a small project. I am creating a simple ship
I'm new to rails and building a small test app on rails3 (beta4). I
I am creating a small app to teach myself ASP.NET MVC and JQuery, and
I like design time data, especially when creating small widgets. For this very simple
I'm creating a small application that I will distribute via NuGet. My web app
I'm creating a small app using python 2.7 with google app engine and I'm
I am creating a small helper function to return a DataTable . I would

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.