There are two tables - Rubric and Question . One to many relationship. The task is to edit the Question with reference to Rubric . I am sampling from both tables. It is not entirely clear how to use data from headings to link them to a question.
def edit @rubrics = Rubric.where(rubric_type: :question); @question = Question.find(params[:id]) end <%= render 'validation_errors', object: @question %> <%= form_for [:admin, @question], html: {multipart: true} do |f| %> <p> <%= f.label :title %> <%= f.text_field :title %> </p> <p> <%= f.label :question %> <%= f.trix_editor :question %> </p> <p> <%= f.label :answer %> <%= f.trix_editor :answer%> </p> <p> <%= f.label :created_at %> <%= f.label :created_at %> </p> <%= f.select :rubric %> <p> <%= f.submit %> </p> <% end %>