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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:50:38+00:00 2026-06-18T18:50:38+00:00

My rails app has a single CustomerSelectionController, with two actions: index: which shows a

  • 0

My rails app has a single CustomerSelectionController, with two actions:

index: which shows a form where the user can enter customer information and
select: which just displays a static page.

class CustomerSelectionController < ApplicationController
  def index
  end

  def select
  end
end

I’ve created an entry in my routes.rb file:

  resources :customer_selection

and the form in the index view looks like:

<h1>Customer Selection</h1>

<%= form_tag("customer_selection/select", :method => "get") do %>
  <%= submit_tag("Select") %>
<% end %>

however when I click on the Select button in the browser, all I get is:

Unknown action

The action ‘show’ could not be found for CustomerSelectionController

I’m not sure why it is trying to perform an action called show? I haven’t defined or referenced one anywhere.

  • 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-18T18:50:39+00:00Added an answer on June 18, 2026 at 6:50 pm

    I’m not sure why it is trying to perform an action called show? I haven’t defined or referenced one anywhere.

    Yes you have. That’s what resources does. It defines the seven default RESTful routes: index, show, new, create, edit, update and destroy. When you route to /customer_selection/select, the route that matches is “/customer_action/:id”, or the “show” route. Rails instantiates your controller and attempts to invoke the “show” action on it, passing in an ID of “select”.

    If you want to add a route in addition to those, you need to explicitly define it, and you should also explicitly state which routes you want if you don’t want all seven:

    resources :customer_selection, only: %w(index) do
      collection { get :select }
      # or
      # get :select, on: :collection
    end
    

    Since you have so few routes, you can also just define them without using resources:

    get "/customer_selection" => "customer_selection#index"
    get "/customer_select/select" 
    

    Note that, in the second route, the "customer_select#select" is implied. In a route with only two segments, Rails will default to “/:controller/:action” if you don’t specify a controller/action.

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

Sidebar

Related Questions

My Rails app has some pages which are SSL-required and others which are SSL-optional.
I'm writing a rails app that has a model called 'User' and a model
I'm writing a Rails app which has the following jasmine spec: describe buttons, ->
I am using paperclip to upload photos in my two rails app which share
i have im my rails app model which has few options (no more than
My rails app has an image upload which uses the latest versions of Carrierwave
I am working on an Rails app which has an admin section for setting
I have a Rails app which has 2 databases. Legacy DB with table called
I'm trying to work on this Rails app which has the following objectives: /foods/
I'm creating a Rails app which has an e-commerce element for multiple clients -

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.