Appendix B. Tidbits

This appendix contains a collection of tidbits that we just couldn’t fit into the rest of the book. They are designed to be read by themselves, although you are welcome (and encouraged!) to read as many of them at once as you wish.

B.1 Prettying URLs

In your application you’ve got a URL such as /projects/1/tickets/2, which really isn’t that pretty. Let’s take a look at how you can make the ticket’s ID part of these URLs a little prettier, turning them into something like /projects/1/tickets/2-make-it-shiny.

Having URLs such as /projects/1/tickets/2-make-it-shiny will allow your users to easily identify what that URL links to without having to visit the page.[1] Rails allows you to very easily do this by overriding a method ...

Get Rails 3 in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.