# Inheritance and forms

**URL:** <https://www.ruby-forum.com/t/inheritance-and-forms/118158>\
**Category:** Rails\
**Created:** [October 24, 2007, 12:07pm UTC](https://www.ruby-forum.com/t/inheritance-and-forms/118158 "2007-10-24T12:07:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Johansson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/9fc348/32.png) [@David\_Johansson](https://www.ruby-forum.com/u/David_Johansson)\
**Post date:** [October 24, 2007, 12:07pm UTC](https://www.ruby-forum.com/t/inheritance-and-forms/118158/1 "2007-10-24T12:07:01Z")

</div>

Hi,

I have two user models - PrivateUser and CorporateUser - in my Rails  
1.2 application. Both are subclasses of User, created by  
restful\_authentication, which defines a user which can log in to my  
application.

Now, I want to let both types of users register. They will need  
different forms to fill out, but the logic is similar. So the use case  
is

- User clicks Register link
- User chooses account type
- User fills out form
- User clicks Register to submit form

In the rest of the application, the two types of users are not very  
similar - they have different roles and should get different views,  
actions etc.

I am looking for the best way to keep my registration DRY - is there  
something smart I can do here, or should I just make two completely  
separate controllers whose code for ‘new’ just happen to be very  
similar?
