Saturday, March 19, 2011

[Rails] Re: Hierarchical URLs

Ah!

Found this video at Railscasts (of course... :) )
http://media.railscasts.com/videos/203_routing_in_rails_3.mov

Regards
Linus

On 19 mar, 17:47, Linus Pettersson <linus.petters...@gmail.com> wrote:
> Hi!
>
> I have two models, artists and songs. Each artist has, of course, many
> songs and each song belongs to one artist. Everything is working fine
> but I want to make my urls look a bit different. I'm very new to Ruby
> and RoR.
>
> Right now my urls looks like this:
> example.com/artists/1    #Listing all of the songs that is related to
> this artist
> example.com/songs/1    #Showing a song
>
> What I want is something like this:
> example.com/music/artist_name/song_name-id
>
> I have tried to find info about this but I don't really know what to
> search for.
>
> Best Regards
> Linus

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate