In my app, I need to perform transactions with external web sites.
(Assume this is a system for placing online orders with restaurants --
it isn't, but the true purpose will be revealed eventually). Each
restaurant's online system is slightly different, requiring slightly
different information from the user.
What I want is a landing page where all the restaurants are listed in a
pull-down list. Upon selecting a specific restaurant, the user gets a
view (more likely a partial) for that specific restaurant where they can
To pull this off, I think I want a generic Model, View and Controller
for a Restaurant, and then sub-classes for specific restaurants.
I'd prefer not to hard-code the restaurant classes into a file -- it
would be better if simply adding the restaurant class files to a
directory caused it to get discovered by the app. And since there can
be an arbitrary number of restaurants, I really don't want them in the
top-level models / controllers / views directories.
My question is really about how to structure the classes and
directories. What's the idiom for doing this kind of thing in Rails?
Are there good examples worth emulating?