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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:01:22+00:00 2026-05-28T01:01:22+00:00

Possible Duplicate: Rails: Routing without plurals gives strange helpers Turns out I had :resources

  • 0

Possible Duplicate:
Rails: Routing without plurals gives strange helpers

Turns out I had :resources qtl_table in config/routes.rb twice! I get this error:

undefined local variable or method `search_qtl_table_index' for #<#<Class:0x805aff3e0>:0x805af47b0>

in app/views/qtl_table/index.html.erb:

<h2>Search for QTL</h2>
<%= form_tag search_qtl_table_index, :method => 'get' do %>
        <%= text_field_tag :search, params[:search] %>
        <%= submit_tag "Search", :name => nil %>
<% end %>

and in config/routes.rb:

Qtl::Application.routes.draw do
    resources :qtl_table do
            collection do
                    get 'search'
            end
    end
  ...
end

yes I do have plurals turned off:

ActiveRecord::Base.pluralize_table_names = false

Output of rake routes:

              search_qtl_table_index GET    /qtl_table/search(.:format)                            {:action=>"search", :controller=>"qtl_table"}
                     qtl_table_index GET    /qtl_table(.:format)                                   {:action=>"index", :controller=>"qtl_table"}
                                     POST   /qtl_table(.:format)                                   {:action=>"create", :controller=>"qtl_table"}
                       new_qtl_table GET    /qtl_table/new(.:format)                               {:action=>"new", :controller=>"qtl_table"}
                      edit_qtl_table GET    /qtl_table/:id/edit(.:format)                          {:action=>"edit", :controller=>"qtl_table"}
                           qtl_table GET    /qtl_table/:id(.:format)                               {:action=>"show", :controller=>"qtl_table"}
                                     PUT    /qtl_table/:id(.:format)                               {:action=>"update", :controller=>"qtl_table"}
                                     DELETE /qtl_table/:id(.:format)                               {:action=>"destroy", :controller=>"qtl_table"}
  • 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-28T01:01:22+00:00Added an answer on May 28, 2026 at 1:01 am

    You may have plurals turned off, but this only affects the table names in the database, not how Rails handles routes.

    Because the search route belongs to a collection, not a member, it acts on multiple model objects. Therefore, the route should be search_qtl_tables_path, note plural tables.

    qtl_table is a model, and you want to search a collection of them, so it make senses that the route reads like “search multiple records”.

    edit: My main concern is that your rake routes shouldn’t be showing those qtl_table routes twice. Are you repeating yourself somewhere in routes.rb?

    OK, so you’ve deleted the extra routes. Now, this should work…

    <%= form_tag search_qtl_table_index_path, :method => 'get' do %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Rails 2.3-style plugins and deprecation warnings running task in Heroku I am
Possible Duplicate: Ruby On Rails 3 and Webrick issue $ rails server /Users/Vineeth/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in `require':
Possible Duplicate: Rails primary key and object id Very quick question. My server is
Possible Duplicate: Ruby/Ruby on Rails ampersand colon shortcut As a habit I try and
Possible Duplicate: Naming Boolean columns in Rails What is the rails convention regarding names
Possible Duplicate: How can I format the value shown in a Rails edit field?
Possible Duplicate: How do I set HTTP_REFERER when testing in Rails? I tried request.env[HTTP_REFERER]
Possible Duplicate: how to check if my array includes an object - rails I
Possible Duplicate: Why is rake db:migrate:reset not listed in rake -T? Inside my Rails
Possible Duplicate: Why are exclamation marks used in Ruby methods? Hi All, In ruby/rails

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.