my models
1. class Empresa < ActiveRecord::Base
2. has_many :usuario
3. end
1. class Usuario < ActiveRecord::Base
2.
3. has_one :empresa
4.
5. (...)
partial _form
<% form_for :empresa, @empresa, :url => {:action =>
''new''} do |emp| %>
<table>
<tr>
<td><label for="empresa_razao_social">Razo
social:</label></td>
<td><%= emp.text_field :razao_social %></td>
</tr>
(...)
<% 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?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
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| %> > <table> > <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?-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---