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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:19:21+00:00 2026-06-03T20:19:21+00:00

I am bit new with Rails (3.) and need your help to use renamed

  • 0

I am bit new with Rails (3.) and need your help to use renamed routes. I have following routes to display and search products.

  namespace :store do
    namespace :product do 
      resources :home
      resources :search
    end 
  end

And rake routes render following output for above resources:

  store_product_home_index GET    /store/product/home(.:format)                       store/product/home#index
                           POST   /store/product/home(.:format)                       store/product/home#create
    new_store_product_home GET    /store/product/home/new(.:format)                   store/product/home#new
   edit_store_product_home GET    /store/product/home/:id/edit(.:format)              store/product/home#edit
        store_product_home GET    /store/product/home/:id(.:format)                   store/product/home#show
                           PUT    /store/product/home/:id(.:format)                   store/product/home#update
                        DELETE    /store/product/home/:id(.:format)                   store/product/home#destroy
store_product_search_index GET    /store/product/search(.:format)                     store/product/search#index
                           POST   /store/product/search(.:format)                     store/product/search#create
  new_store_product_search GET    /store/product/search/new(.:format)                 store/product/search#new
 edit_store_product_search GET    /store/product/search/:id/edit(.:format)            store/product/search#edit
      store_product_search GET    /store/product/search/:id(.:format)                 store/product/search#show
                           PUT    /store/product/search/:id(.:format)                 store/product/search#update
                        DELETE    /store/product/search/:id(.:format)                 store/product/search#destroy

Instead of having path like /store/product/home, I wanted to rename as /products/home.

So modified routes should look like following:

  store_product_home_index GET    /products/home(.:format)                       store/product/home#index
                           POST   /products/home(.:format)                       store/product/home#create
    new_store_product_home GET    /products/home/new(.:format)                   store/product/home#new
   edit_store_product_home GET    /products/home/:id/edit(.:format)              store/product/home#edit
        store_product_home GET    /products/home/:id(.:format)                   store/product/home#show
                           PUT    /products/home/:id(.:format)                   store/product/home#update
                        DELETE    /products/home/:id(.:format)                   store/product/home#destroy
store_product_search_index GET    /products/search(.:format)                     store/product/search#index
                           POST   /products/search(.:format)                     store/product/search#create
  new_store_product_search GET    /products/search/new(.:format)                 store/product/search#new
 edit_store_product_search GET    /products/search/:id/edit(.:format)            store/product/search#edit
      store_product_search GET    /products/search/:id(.:format)                 store/product/search#show
                           PUT    /products/search/:id(.:format)                 store/product/search#update
                        DELETE    /products/search/:id(.:format)                 store/product/search#destroy

Note that I am using Rails 3.2.1.

Any help you can provide is greatly appreciated.

  • 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-03T20:19:24+00:00Added an answer on June 3, 2026 at 8:19 pm

    As I understand you just want the /store namespace to be removed?

    replace

     namespace :store do
        namespace :product do 
          resources :home
          resources :search
        end 
      end
    

    with

    namespace :product do 
      resources :home
      resources :search
    end 
    

    if you want to keep the namespace for structural reasons try

     namespace :store,:path => "" do
        namespace :product do 
          resources :home
          resources :search
        end 
      end
    

    hope this helps!

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

Sidebar

Related Questions

I'm new to Rails, and a bit confused about routes: I have a Devices
I'm new to Rails and I know a bit of Jquery. I need a
I am trying to use the following bit of code to help in seeding
I have been reading a bit on JSON and rails (I am new to
I'm a bit new to Rails/RSpec/Capybara, so this is probably a newbie question, but
I'm a bit new to js and have been trying to figure out how
I'm a bit new to SQL and have trouble constructing a select statement. I
I have a few data values that I need to store on my rails
I'm a bit new to web development so bear with me please. I have
I a bit confused about how I could use git branches with rails. When

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.