resources :pages do
resources :images, controller: 'pages/images'
end
resources :images
# /app/controllers/pages/images_controller.rb
class Pages::ImagesController < ApplicationController
...
def index
@page = Page.find(params[:page_id])
@images = @page.images
end
...
end
# /app/controllers/images_controller.rb
class ImagesController < ApplicationController
...
def index
@images = Images.all
end
...
end