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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:11:20+00:00 2026-06-12T08:11:20+00:00

I have an e-commerce web site written in Rails 3.2.8 which sells tickets for

  • 0

I have an e-commerce web site written in Rails 3.2.8 which sells tickets for music events. So far I’ve been using simple RESTful routes in the application:

/ => default route: /events
/events
/events/1
/events/1/new
/events/2
...

All events used to happen in the same place, but from now on there’s going to be two places, let’s say “Morumbi” and “Maracanã”. Place is a model in the application, and it’s a very important distinction between the events. So I’d like to make the place name a part of the path, and have routes like this:

/ => default route: page to choose place
/morumbi => same as /morumbi/events
/morumbi/events/1
/morumbi/events/1/new
/maracana => same as /maracana/events
/maracana/events/2
...

Although I know how to do that using the #match method, I have already a good number of routes created with the much more maintainable #resources method, and I’d like to keep them.

Do you know a solution avoiding the use of #match?

  • 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-12T08:11:21+00:00Added an answer on June 12, 2026 at 8:11 am

    You need to use the #scope method:

    scope path: ':place_name', as: 'place' do
      resources :events
      ...
    end
    

    So GET /morumbi/events/1 will call EventsController#show with parameters id: '1' and place_name: 'morumbi'.

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

Sidebar

Related Questions

We have a fairly high volume ASP.Net site written in c# using MS commerce
Here is the thing. Right now I have this e-commerce web site where people
I have ssl in my e-commerce web site. At first, browser always asking do
I have been working on ASP.net MVC3 Web application using MSSQL 2008 R2 for
I have an E-Commerce Rails Application where we need to output Orders placed by
have written this little class, which generates a UUID every time an object of
I'm about ready to launch our company's web site on Amazon's EC2, and have
I am a beginner at software development and web site development. I love using
I've recently inherited a database driven e-commerce site written in C# ASP.Net, with an
I have been working on asp.net mvc3 e-commerce application based on NopCommerce. Recently we

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.