I have something like this:
class Employee < ActiveRecord::Base
has_one :office
end
class Office < ActiveRecord::Base
belongs_to :employee # foreign key - employee_id
end
If I want to edit the employee, at this form what can I fo to edit the office data?
<% form_for(@employee) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :employeeName %><br />
<%= f.text_field :employeeName %>
</p>
<!-- what should I add? -->
<p>
<%= f.submit 'Update' %>
</p>
<% end %>