my models
-
class Empresa < ActiveRecord::Base
-
has_many :usuario
-
end
-
class Usuario < ActiveRecord::Base
-
-
has_one :empresa
-
-
(…)
partial _form
<% form_for :empresa, @empresa, :url => {:action => ‘new’} do |emp| %>
Razão social: |
<%= emp.text_field :razao_social %> |
(…)
<% fields_for :usuario, @empresa.usuario do |usr|%>
<table>
<tr>
<td>Nome:</td>
<td><%= usr.text_field :nome %></td>
</tr>
(…)
appear the follow error message:
Esta aparecendo o seguinte erro: undefined method `nome’ for
Usuario:Class
What I am making of made a mistake?
Hello,
I am aslo getting the same error regarding undefined local variable or
method. HAve you figured out what went wrong.
Could you please tell me the solution if you have resolved it by now.
Thanks.
Regards,
Anks
partial _form
<% form_for :empresa, @empresa, :url => {:action => ‘new’} do |emp| %>
appear the follow error message:
Esta aparecendo o seguinte erro: undefined method `nome’ for
Usuario:Class
What I am making of made a mistake?