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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:22:22+00:00 2026-06-14T05:22:22+00:00

although I saw this problem in other blogs, I couldn’t make it works in

  • 0

although I saw this problem in other blogs, I couldn’t make it works in my case.
My view:

<%= semantic_form_for :routes_status_race, :url => status_race_admin_routes_path do |f| %>
    <% contact_array = Contact.all.map {|contact| [contact.name, contact.id]}%>
    <% route_importer_array = RouteImporter.all.map {|importer| [importer.name, importer.id]}%>
    <%= f.inputs do%>
        <%= f.input :contact, :as => :select, :collection => Contact.all %>
        <%= f.input :route_import, :as => :select, :collection => RouteImporter.all %>
        <%= f.input :uploaded_data, :action => :status_race, :multipart => true, :as => :file %>
    <%end%>
    <input name='commit' type='submit' method='post' value='Import'/>
<%end%>

My controller:

collection_action :status_race, :method => :post do

    uploaded_io = params[:uploaded_data].original_filename

    File.open(Rails.root.join('app/importers', 'uploads', uploaded_io.original_filename), 'w') do |file|
      file.write(uploaded_io.read)
    end

    RoutesQuickcom.new.run(uploaded_io.original_filename)
    render "status_race"
  end

I get this error:undefined method `original_filename’ for nil:NilClass in my controller and I don’t know how to fix it, any help will be appreciate, 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-06-14T05:22:24+00:00Added an answer on June 14, 2026 at 5:22 am

    You called original_filename 3 times, remove two original_filename and it will works:

    collection_action :status_race, :method => :post do
    
      uploaded_io = params[:uploaded_data].original_filename
    
      File.open(Rails.root.join('app/importers', 'uploads', uploaded_io), 'w') do |file|
        file.write(uploaded_io.read)
      end
    
      RoutesQuickcom.new.run(uploaded_io)
      render "status_race"
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Although I have found some solutions to this problem, none of them refer to
I saw this in one of Heinz Kabutz's Java Specialist newsletter editions and, although
Although this code is from an algorithm text, I have a bit of a
Although the classic ASP method of server-side includes works in ASP.NET, I get the
I saw Versioning and Optimistic Locking – combined with real-time get, this allows read-update-write
I saw this answer of how to create a placeholder for UITextView. I took
Possible Duplicate: Difference between pointer variable and reference variable in C++ I saw this
Is there a general difference between doing (*ptr).method() vs ptr->method() I saw this question
So I saw this question/comment... How to integrate SQL Server 2005 Express Edition to
Ok, I was scanning through some code yesterday and I saw this, Code: public

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.