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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:53:47+00:00 2026-05-25T21:53:47+00:00

I created a search and replace controller, with just an index action. Since it’s

  • 0

I created a search and replace controller, with just an index action. Since it’s meant to go under one of my restful controllers created by a scaffold, i setup the following in the routes file:

resources :sites do
  resource :search_and_replace, only: [:index]
end

However, it does not appear when I run rake routes. If I switch to resources, it does. But the method name is site_search_and_replace_index. The pluralization of resource doesn’t feel right either, since this is not around multiple records in a 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-25T21:53:47+00:00Added an answer on May 25, 2026 at 9:53 pm

    The index action doesn’t exist in a singular resource. This makes sense if you think of the meaning of the action: index of what, there’s only one resource? Use show instead:

    resources :sites do
      resource :search_and_replace, only: [:show]
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a search with a couple of comboboxes that allow users to filter
I created a div(search result term bar) which should display only when user enters
i created a project to search textfiles with lucene.net. [asp.net/vs08] these textfiles are in
I've created a program in Delphi that uses Google's AJAX Search API to evaluate
I created a Linked List, with insert, search and remove functions. I also created
How do I use the UNIX command find to search for files created on
Good Morning, I have created an ASP.NET 3.5 webform that allows users to search
I want to use custom action filter to manipulate parameters to one action. User
I am trying to get my TagsController#index action to display only the Questions that
I have recently just started working with Lucene (specifically, Lucene.Net) and have successfully created

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.