title: Rails - Conditional Form Elements?
body: <p>I have the following in a form:</p>
  
  <p>&lt;%= f.hidden_field (:project_id,  :value => @project.id) %></p>
  
  <p>This form partial sometimes contains a @project. Sometimes it does not. This is the nature of the app.</p>
  
  <p>But I want to use one partial because it's a big form. Problem here is if it does not contain @project, the page ERRORS....</p>
  
  <p>How can I do the following:</p>
  
  <ul>
  <li>Only render the hidden field if @project is defined</li>
  <li>If @project is not defined, give the field a value of =""</li>
  </ul>
  
  <p>Thank you!</p>