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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:22:30+00:00 2026-06-09T12:22:30+00:00

I am using nested routes in my application (rails 3.2) as follows: resources :networks

  • 0

I am using nested routes in my application (rails 3.2) as follows:

resources :networks do
  resources :groups
end

The route for groups show page is as follows

network_group GET    /networks/:network_id/groups/:id(.:format)

How can I change the parameters to :network_name and :group_name respectively? Also, I would like to rename the route to group_path (instead of network_group_path ). I would like these changes reflected for all the routes without having to use ‘match’ for the individual routes.

Is it possible to have something like group_path(@network, @group) return ‘/networks/global/groups/all’, where ‘global’ and ‘all’ are both ‘name’ attribute for the respective models. (by default I get the id’s in the url)

  • 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-09T12:22:31+00:00Added an answer on June 9, 2026 at 12:22 pm

    We can do that by adding a to_param method in our model

    http://railscasts.com/episodes/63-model-name-in-url

    In your network and group model, add a #to_param method that returns what you want in the URL (network_name, group_name).

    Or else you can use friendly_id gem which gives pretty urls.

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

Sidebar

Related Questions

I'm using the friendly_id gem. I also have my routes nested: # config/routes.rb map.resources
I'm using Rails 2. I have resources nested like this: - university_categories - universities
I am wondering how people handle nested/complex routes for an application when using a
I have a nested route as: resources :wsps do member do get :location get
Error: No route matches {:action=>new, :controller=>comments, :parent_id=>1} routes.rb: MyApp::Application.routes.draw do resources :posts do resources
I am using nested Asynchronous callbacks to save my front-end data to the back-end
I'm using nested entity groups in an HRD google app engine datastore. A <
I'm using nested pages in Jquery Mobile: Looks like this: // wrap page <div
I'm trying to get an average of sums using nested aggregate functions and grouping.
I'm using nested routes and I want to provide some sort of a shortcut

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.