Hello, I have the following in a form:
<%= f.hidden_field (:project_id, :value => @project.id) %>
This form partial sometimes contains a @project. Sometimes it does not. This is the nature of the app.
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....
How can I do the following:
- Only render the hidden field if @project is defined
- If @project is not defined, give the field a value of =""
Thank you!