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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:35:25+00:00 2026-06-14T07:35:25+00:00

I seem to be stuck on figuring out the best approach to let a

  • 0

I seem to be stuck on figuring out the best approach to let a user upload a text file, have my application parse the file, and then return some output via ajax directly back on the same page. Is there an easy way to do this?

I have been using the following and it works wonderfully but I can’t get it to work with ajax.

Here is the view file – index.html.erb

<%= form_tag 'log/new', :multipart => true do %>
<label for="file">Please upload a log file to continue</label> <%= file_field_tag "file" %>
<%= submit_tag ('Upload')%>
<% end %>

I am then able to play with the results in my controller using params[:file] just fine but when I add :remote => true to my form it won’t let me do any AJAX or run my .js.erb view file, presumably for security reasons since the js can’t read the XHR request yadda yadda.

I have also tried CarrierWave and jquery-fileupload-rails gems but I don’t want to save it to the database first which carrier wave seemed to want to do and jquery-fileupload seems to do the same. In any event, even if I get the file uploaded/saved to db with one of those gems – how am I able to access the contents like I was able to with my params[:file] approach?

  • 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-14T07:35:26+00:00Added an answer on June 14, 2026 at 7:35 am

    If you want to upload file with AJAX and rails forms you can use remotipart gem:

    Remotipart is a Ruby on Rails gem enabling AJAX file uploads with
    jQuery in Rails 3.0 and Rails 3.1 remote forms. This gem augments the
    native Rails jQuery remote form functionality enabling asynchronous
    file uploads with little to no modification to your application.

    For me it works with Rails 3.2 as well.

    https://github.com/JangoSteve/remotipart

    http://rubygems.org/gems/remotipart

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

Sidebar

Related Questions

I seem to have stuck numerous hours in a modal dialog with unexpected behavior
I seem to be mentally stuck in a Flyweight pattern dilemma. First, let's say
I have been stuck on this for a while now and I cannot seem
I'm working on learning Objective-C/Coaoa, but I've seem to have gotten a bit stuck
Ive got a bit stuck figuring it out for the negative direction? it must
I seem to be having problems figuring out why the heck I keep getting
I'm stuck on something, and can't seem to think of a solution. I have
despite the ocean of smart pointer questions out there, I seem to be stuck
I seem to be stuck. Is there a way to export Application.Current of a
I seem to be stuck and am not sure which is the best direction

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.