title: Custom Nested Routing in Rails 2.3
body: <p>I'm trying to change some URLs in this project I'm working on, but I can't find any examples of what I'm looking for in any documentation and all my attempts seem to end up not working.</p>
  
  <p>Here's what I'm trying to do. I have a post that has several images, and an individual image would be accessed with an URL like this:</p>
  
  <pre><code>/posts/aliased_title/images/2
  </code></pre>
  
  <p>However, I want to change it so I can remove the "posts" and "images" part of the URL, change it to something like <strong>/aliased_title/2</strong>.</p>
  
  <p>I know how to do this for a single controller, but how can I accomplish this with the images controller as well? Can I do this in a way that will generate the "paths" (like post_image_path), or do I need to hard code every single action into the routing?</p>
  
  <p>Thank you in advance.</p>