While working on a Rails project recently, I had a problem that I’m sure many people can relate to—I had a
<select> tag in my view, and I needed customers to choose from several options that directly corresponded to some of the models in my application. Fortunately the models were well-named, so I could use a slightly modified versions of the class name for each
<option> tag. All of these models were subclasses of one parent class, and some had their own descendant classes as well (which I did not need to include in the
<select>). Finally, none of these models needed to persist to the database.