Assuming Rails 1.2.x
Your routes will be something like:
Now you will have URLs / Path's like ... galleries_path, photos_path(gallery), photo_path(glallery, photo)
map.resources :galleries do |gallery|
in you controllers....
You won't need a show method in the galleries controller, as the photos controller index will be pretty much the same thing.
class GalleriesController < ApplicationController
# Show all galleies: /galleries (galleries_path)
class PhotosController < ApplicationController
# Show photos for a given gallery
# All your photos are in gallery.photos
# Show a photo: /galleries/:gallery_id/photos/:id (photos_path(gallery, photo))
@photo = gallery.photos.find params[:id]
# Other stuff here
@gallery = Gallery.find params[:gallery_id]