On 12 July 2011 21:47, Rodrigo Ruiz <rodrigo.ru...@gmail.com> wrote:
> views/companies:
> <% f.fields_for :company_contact do |company_contact_form| %>
>  <div class='field'>
>    <%= company_contact_form.label 'Name of the responsible for marketing' %>
>    <%= company_contact_form.text_field :marketing_name %>
>  </div>
> <% end %>
> CompaniesController:
> def new
>     @company = Company.new
>     @company.build_company_contact
> end
> Company model:
> has_one :company_contact, :dependent => :destroy
> accepts_nested_attributes_for :company_contact
>
> This code doesn't crash or show any error, but it just doesn't show the
> CompanyContact information at the form.

So it probably has worked then.  Now you have a different problem you
need to investigate.  Have a look at the Rails Guide on debugging to
get ideas on how to proceed.  Using ruby-debug to break into your code
and inspect data and follow the flow is particularly useful.

Colin

>
> On Tue, Jul 12, 2011 at 4:40 PM, Colin Law <clan...@googlemail.com> wrote:
>>
>> On 12 July 2011 16:32, Rodrigo Ruiz <rodrigo.ru...@gmail.com> wrote:
>> > And no, it doesn't work =/
>>
>> It is no good just saying it doesn't work, what hope has anyone here
>> got of helping further if that is all the information you give?  Show
>> us the modified code and the new error message you are getting.
>>
>> Colin
>>
>> --
>> 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@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-talk+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>
> --
> 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@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>

-- 
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@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to