routes & friendly URL's

I have a Rails3 app with three resources: - League (has_many :teams) - Team (belongs_to :league, has_many :players) - Player (belongs_to :team)

With standard nested routes, I get URLs like:

/leagues (lists all leagues) /leagues/2 (shows league #2) /leagues/2/teams (lists all teams in league #2) /teams/1 (shows team #1) /teams/1/players (lists all players in team #1) /players/1 (shows player #1)

I would like 'user friendly' urls like:

/west_conference/ (shows league 'west_conference') /west_conference/teams (lists all the teams in the west conference) /west_conference/eagles (shows the team 'eagles') /west_conference/eagles/players (lists all players on the eagles) /west_conference/eagles/smith (shows the player 'smith')

How do I configure my Rails3 app to add user_friendly urls like this?

tx, Andy

I have a Rails3 app with three resources: - League (has_many :teams) - Team (belongs_to :league, has_many :players) - Player (belongs_to :team)

With standard nested routes, I get URLs like:

/leagues (lists all leagues) /leagues/2 (shows league #2) /leagues/2/teams (lists all teams in league #2) /teams/1 (shows team #1) /teams/1/players (lists all players in team #1) /players/1 (shows player #1)

I would like 'user friendly' urls like:

/west_conference/ (shows league 'west_conference') /west_conference/teams (lists all the teams in the west conference) /west_conference/eagles (shows the team 'eagles') /west_conference/eagles/players (lists all players on the eagles) /west_conference/eagles/smith (shows the player 'smith')

How do I configure my Rails3 app to add user_friendly urls like this?

Aside from a bit of manual routing, have you seen friendly_id?

andyl wrote in post #965181:

I have a Rails3 app with three resources: - League (has_many :teams) - Team (belongs_to :league, has_many :players) - Player (belongs_to :team)

With standard nested routes, I get URLs like:

/leagues (lists all leagues) /leagues/2 (shows league #2) /leagues/2/teams (lists all teams in league #2) /teams/1 (shows team #1) /teams/1/players (lists all players in team #1) /players/1 (shows player #1)

I would like 'user friendly' urls like:

/west_conference/ (shows league 'west_conference') /west_conference/teams (lists all the teams in the west conference) /west_conference/eagles (shows the team 'eagles') /west_conference/eagles/players (lists all players on the eagles) /west_conference/eagles/smith (shows the player 'smith')

How do I configure my Rails3 app to add user_friendly urls like this?

There are several ways to do this. Most of them involve overriding to_param and/or installing a gem such as friendly_id or permalink_fu. Search the list archives for ideas; this comes up pretty frequently.

tx, Andy

Best,