I have a _form partial for surv_rdsap_xrefs controller.
I want to keep the error methods in the form and the fields are rendering from two different folders. one is condtion/rdsap_xrefs/_surv_rdsap_xrefs and another is section/condition/_question.
_form:
<%= form_for(@enr_rds_surv_rdsap_xref) do |f| %>
<% if @enr_rds_surv_rdsap_xref.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@enr_rds_surv_rdsap_xref.errors.count, "error") %>:</h2>
<ul>
<% @enr_rds_surv_rdsap_xref.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="left">
<%= render 'section/condition/_question' %>
</div>
<div class="right">
<%= render 'condition/rdsap_xref/surv_rdsap_xref' %>
</div>
<% end %>
Now, i got the error of undefined method of f in the partials. How to partial these two for the same form. Thanks
try this
As in partials there must be a variable
fto which you have to assign some value. Thats why I have assigned thefofform_forinto the partial variablef