-
Notifications
You must be signed in to change notification settings - Fork 21
Model: model_type
rubytester edited this page Oct 2, 2013
·
3 revisions
The model_type is a way of giving a hint to controllers about models that they can consume
For example, let's say we have a Donation controller and it's configured to take a model that's a Donor. We want to be able to pass in a Single Donation Donor and a Recurring Donation Donor to that same controller and have the controller automatically know it has a relationship with that model.
Donation < Watirmark::WebPage::Controller
@model = Donor
@view = DonationView
end
class SingleDonorModel < Watirmark::Model::Factory
keywords SingleDonorModelView.keywords
model_type Donor
end
class RecurringDonorModel < Watirmark::Model::Factory
keywords RecurringDonorModelView.keywords
model_type Donor
end