First: "create the form" on the "employee show" page I do not know if it is necessary, by convention forms are in the "new.html.erb" view, but if that is what you want, a form on the same page in which displays the user information, the form is created in the same way.
In addition, you need a has_many relationship between the employee and the report (an employee has multiple reports).
#app/controllers/offices_controller.rb
class OfficesController < ApplicationController
def show
@employee = Employee.find(params[:id]) # Aqui você está pegando o funcionário
@report = Report.new # Aqui você cria uma nova instância de um objeto Report
end
end
# app/views/offices/show.html.erb
<%= @employee.name %>
<%= @employee.age %>
<%= @employee.salary %>
<%= form_for(@report) do |f| %>
<%= f.hidden_field :employee_id, value: @employee.id %>
<%= f.text_field :salary, value: @employee.salary %>
<%= f.submit %>
<% end %>
#app/controllers/reports_controller.rb
class ReportsController < ApplicationController
def create
Report.create(report_params)
end
private
# Aqui é a validação do Strong Parameters, para uma validação que se encaixe
# com suas necessidades consulte a documentação:
# https://github.com/rails/strong_parameters
def report_params
params.fetch(:report).permit!
end
end