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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:32:51+00:00 2026-05-26T16:32:51+00:00

I am a newbie to the ruby on rails platform and I was just

  • 0

I am a newbie to the ruby on rails platform and I was just trying out couple of example codes.
I was trying to run this example http://goodbadtech.com/2009/05/13/ruby-on-rails-import-csv-data-into-database/
I followed all the instructions but I am getting this error

ActionController::RoutingError (uninitialized constant CsvImportController):

Please help me to bash this error.

Here is my Routes.rb

Imports::Application.routes.draw do
  # The priority is based upon order of creation:
  # first created -> highest priority.
 get "csv_imports/csv_view"
#map.resources :imports
#map.import_proc '/import/proc/:id', :controller => "imports", :action => "proc_csv"
  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

    resources :imports
    import_proc '/import/proc/:id', :controller => "csv_imports", :action => "pro_csv"
    end 

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => 'csv_imports#csv_view'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'
  • 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-26T16:32:51+00:00Added an answer on May 26, 2026 at 4:32 pm

    Your file, containing the class CsvImportsController should be named csv_imports_controller. I believe that is the error. In your routing, you should have

    resources :csv_imports
    

    [EDIT] On the other hand, if your controller is named ImportsController, placed in imports_controller.rb, then inside your routing, you should have

    resources :imports
    

    Rails automatically tries to tie things together based on the names. This is what makes things easy if you follow them correctly. So resources :imports will assume there is a controller called ImportsController, which can be found in app/controllers/imports_controller.rb. It is best practice to call the relevant model Import, to be found in app/models/import.rb.

    Hope this helps.

    (also note that the blog-post you mention is for Rails 2 and not Rails 3)

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

Sidebar

Related Questions

I'm Ruby/Rails newbie and trying to get the laika tool ( http://github.com/CCHIT/laika/tree/master ) running
hey I am newbie to ruby on rails and I am trying run a
Still a rails and ruby newbie, and I'm trying to figure out why adding
I am newbie in Ruby. I installed by following this tutorial: http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/ Now, when
I'm a Ruby-on-Rails newbie, just starting out. I have an MVC called account_types, generated
I a newbie trying to write a [Ruby ON Rails] spec to make sure
I'm a newbie ruby on rails programmer, so forgive me if this is a
I've just started learning Ruby on Rails and it's a newbie question. I did
I am just starting to learn Ruby on Rails and have a newbie question
I'm newbie at ruby, I spent couple hours trying to find the way to

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.