I have a signup process that has two signup forms, depending on whether you are an individual or company, both get posted to the same model (User with devise). I am setting up my validations within the model, but was wondering how I would go about setting validations for the input fields that differ on each form.
For example :company_no is only on the company sign up form, but if I add a validation for this field the individual signup form will fail and throw an error on the :company_no field
I have set these links up to take the user to the correct form
<p><%= link_to 'Sign Up as Individual', new_user_registration_path %></p>
<p><%= link_to 'Sign Up as Vets/Rescue Centre', new_user_registration_path(organization: true) %></p>
View
<% if params[:organization] %>
<%= render 'shared/company_signup_form' %>
<% else %>
<%= render 'shared/individual_signup_form' %>
<% end %>
An example of a simple validation I am trying to use
class User < ActiveRecord::Base
validates :company_no, presence: true
end