baarkerlounger
3 years ago
5 changed files with 33 additions and 15 deletions
@ -0,0 +1,11 @@ |
|||||||
|
<% genders = [ |
||||||
|
OpenStruct.new(id: 0, name: "Male"), |
||||||
|
OpenStruct.new(id: 1, name: "Female"), |
||||||
|
OpenStruct.new(id: 2, name: "Non-binary"), |
||||||
|
OpenStruct.new(id: 3, name: "Prefer not to say") |
||||||
|
] %> |
||||||
|
|
||||||
|
<%= form_with model: @case_log, method: "patch", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> |
||||||
|
<%= f.govuk_collection_radio_buttons :tenant_gender, genders, :id, :name, legend: { text: "Which of these best describes the tenant's gender identity?", size: "l" } %> |
||||||
|
<%= f.govuk_submit "Save and continue" %> |
||||||
|
<% end %> |
@ -1,12 +1,14 @@ |
|||||||
class AddQuestionFieldsToCaseLogs < ActiveRecord::Migration[6.1] |
class AddQuestionFieldsToCaseLogs < ActiveRecord::Migration[6.1] |
||||||
def change |
def change |
||||||
add_column :case_logs, :tenant_code, :string |
change_table :case_logs, bulk: true do |t| |
||||||
add_column :case_logs, :tenant_age, :integer |
t.column :tenant_code, :string |
||||||
add_column :case_logs, :tenant_gender, :string |
t.column :tenant_age, :integer |
||||||
add_column :case_logs, :tenant_ethnic_group, :string |
t.column :tenant_gender, :string |
||||||
add_column :case_logs, :tenant_nationality, :string |
t.column :tenant_ethnic_group, :string |
||||||
add_column :case_logs, :previous_housing_situation, :string |
t.column :tenant_nationality, :string |
||||||
add_column :case_logs, :prior_homelessness, :integer |
t.column :previous_housing_situation, :string |
||||||
add_column :case_logs, :armed_forces, :string |
t.column :prior_homelessness, :integer |
||||||
|
t.column :armed_forces, :string |
||||||
|
end |
||||||
end |
end |
||||||
end |
end |
||||||
|
Loading…
Reference in new issue