Creating a new Y object from X's controller

If I am in the controller for Model X, and inside a method there I want to create a new instance of (i.e. insert a new row into the DB table for) Model Y, how do I express this? Thanks, R.Vince

controllers don't care what models you use.


Like Eric said. Y.attribute1 = attribute1value Y.attribute2 = attribute2value



One controller can manage multiple models, and one model can be managed by multiple controllers. I frequently set up additional Restful controllers to manage single attribute changes within a model, even though another controller manages other parts of the model.