我覺得我應該知道這一點,我確信這可以做得更乾淨,但我不太確定最好的方式去做。我怎樣才能更清楚地重寫這組路線?
這樣的一組路線怎麼可能以更乾的方式書寫?
# Artists
match "/:id/remixes", :to => "artists#remixes", :as => "artist_remixes"
match "/:id/originals", :to => "artists#originals", :as => "artist_originals"
match "/:id/popular", :to => "artists#popular", :as => "artist_popular"
match "/:id/mashups", :to => "artists#mashups", :as => "artist_mashups"
match "/:id/covers", :to => "artists#covers", :as => "artist_covers"
match "/:id/productions", :to => "artists#productions", :as => "artist_productions"
match "/:id/features", :to => "artists#features", :as => "artist_features"
這就是它!路徑:'/'部分是我所需要的。 –
只要給任何人閱讀便條,我的路徑被翻轉(這是有道理的)是'remixes_artist','originals_artist'等。 –