Hey guys, Lets say I have the following nested resources: map.resource artists do |artists| map.resource songs end To create a new song, the url would be: /artists/:artist_id/songs/:song_id However, lets say that an artist doesn''t exist yet. I only want to create an artist if a new song by the artist is successfully saved. I am retrieving the artist using something like: @artist = find_or_intialize_by_country_id(@country) Since the artist doesn''t exist yet, there will be no ''id'' attribute yet. However, I have to pass in an id to the url which creates the song, ie: new_song_path(@artist) This will obviously fail since @artist.id is nil. I can use find_or_create_by instead, but then if the user cancels creating a song, I will be left with an extra row in the artist table that I don''t need. Any ideas? Shane Vitarana http://shanesbrain.net --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---