I am having a little trouble figuring how to do this.
here’s my scenario
A User must create a IncomeDeclaration for his Business.
But an IncomeDeclaration includes many ActivityIncomeDeclarations for each Activity that his business is on.
I would like my form to include the fields for the new IncomeDeclaration as well as the fields for the ActivityIncomeDeclarations (which will be obviously related to that IncomeDeclaration)….
I know that rubyonrails has a method called “accepts_nested_attributes_for” tgat would probably help me here..
Please help!
This is very easy to achieve. ASP NET MVC is very compositional and you can use templates to achieve this but inheritance is not the way to go.
so solution is for
IncomeDeclarationto contain a list ofActivityIncomeDeclarationsand then do this:More info:
http://www.asp.net/mvc/videos/mvc2-template-customization
http://www.dalsoft.co.uk/blog/index.php/2010/04/26/mvc-2-templates/