title: Is there any way to keep validate field optional in rails?
body: <p>I have User model which includes 7 fields. for all these fields validation is written.i have two form where i am displaying fields depend on condition. in one form i have name password and city and other form i have role,phone and name. </p>
  
  <p>When i try to submit the first form i got the error which says phone and role field are required resulting into failure of form. </p>
  
  <p>Is there any way by which i can submit both form without getting the validation errors ??</p>
  
  <p>Note : i want my logic to be in model only.. Please help me with this problem.</p>