助けてくれてありがとう!!
私は最初のRailsアプリを構築していますが、この問題があります:
「Expediente」というクラスの足場を作成しました.index.html.erbから@expedientesにアクセスできますが、new.html.erbからはできません.
コードは次のとおりです。
//index.html.erb、これは素晴らしい実行です: . . .
<% @expedientes.each do |expediente| %>
<tr>
<td class="custom"> <%= expediente.id %> </td>
<td class="custom"> <%= expediente.tipo_expediente %> </td>
<td class="custom">
<% expediente.pacientes.each do |paciente| %>
<%= paciente.nombre_completo %><br/>
<% end %>
. . .
//new.html.erb、これはまったく機能せず、nil:NilClass エラー メッセージに対して未定義のメソッド `each' を送信します。
. . .
<% @expedientes.each do |expediente| %>
<%if expediente.individual?%>
<% expediente.pacientes.each do |paciente| %>
<option value=126><%= paciente.nombre_completo %></option>
<%end%>
<%end%>
<%end%>
. . .
再びあなたの助けに感謝します!!