Fearless Fool wrote in post #971084: > 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).
It's really hard to provide accurate advice with inaccurate information. > 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 > enter information. That's easy enough. > > To pull this off, I think I want a generic Model, View and Controller > for a Restaurant, and then sub-classes for specific restaurants. No, you probably don't. What you probably want is a fairly generic Restaurant object with some sort of configuration property. > > 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? You can use namespaced models, views, and controllers. But your architectural approach is almost certainly wrong. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.