I have this in my view:
New client
<%= error_messages_for :client %>
<%= error_messages_for :entity %>
<% form_for(@client) do |f| %>
<% render :partial => “entities/entity_fields_for”, :object =>
“@entity” %>
Client status
<%= f.text_field :client_status %>
Client credit policy
<%= f.text_field :client_credit_policy %>
I have this in entities/_entity_fields_for.html.erb
Entity Header
<% fields_for(@entity) do |e| %>
Entity Name
<%= e.text_field :entity_name %>
<p>
<b>Entity Legal Name</b><br />
<%= e.text_field :entity_legal_name %>
</p>
<p>
<b>Entity Legal Form</b><br />
<%= e.text_field :entity_legal_form %>
</p>
<% end %>
When I try and add a new client I only see this:
New client
XXXXXXXXXXXXXXXXXXXXXXXX
Client status
XXXXXXXXXXXXXXXXXXXXXXXX
Client credit policy
XXXXXXXXXXXXXXXXXXXXXXXX
Client credit terms
XXXXXXXXXXXXXXXXXXXXXXXX
Effective from
XXXX XXXXXXXX XX
Superseded after
XXXX XXXXXXXX XX
Back
and in the log I see this:
Processing ClientsController#new (for 127.0.0.1 at 2008-03-14 15:13:12)
[GET]
Session ID:
BAh7BzoMY3NyZl9pZCIlODdiM2M2YWNlZWVmZTFmYTgzMDk5MzQ2ODI0MWI2%0AYzAiCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhh%0Ac2h7AAY6CkB1c2VkewA%3D–183ba94d00e732557171e89ef1b916a18f66701d
Parameters: {“action”=>“new”, “controller”=>“clients”}
Rendering template within layouts/clients
Rendering clients/new
Rendered entities/_entity_fields_for (0.00370)
Completed in 0.05382 (18 reqs/sec) | Rendering: 0.01708 (31%) | DB:
0.00000 (0%)
So what obvious ( to others) thing am I leaving out or not doing with
respect to displaying the partial? If the code that is in the partial
is left in the new template then it displays as expected.