Browse Source

fixed edit name

juris_katrina_test
JG 2 years ago
parent
commit
9ef2b6bc3b
  1. 2
      app/models/location.rb
  2. 4
      app/views/schemes/edit_name.html.erb
  3. 8
      config/locales/en.yml

2
app/models/location.rb

@ -1,6 +1,6 @@
class Location < ApplicationRecord
validate :validate_postcode
validates :type_of_unit, :wheelchair_adaptation, presence: true
validates :units, :type_of_unit, :wheelchair_adaptation, presence: true
belongs_to :scheme
attr_accessor :add_another_location

4
app/views/schemes/edit_name.html.erb

@ -28,13 +28,11 @@
label: { text: "This scheme contains confidential information" } %>
<% end %>
<% null_option = [OpenStruct.new(id: "", name: "Select an option")] %>
<% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %>
<% answer_options = null_option + organisations %>
<% if current_user.support? %>
<%= f.govuk_collection_select :owning_organisation_id,
answer_options,
organisations,
:id,
:name,
label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" },

8
config/locales/en.yml

@ -71,11 +71,11 @@ en:
location:
attributes:
wheelchair_adaptation:
blank: "Enter the existing organisation’s name"
total_units:
blank: "Enter the existing organisation’s name"
blank: "Select if majority of units in this location built or adapted to wheelchair-user standards"
units:
blank: "Enter total number of units at this location"
type_of_unit:
blank: "Enter the existing organisation’s name"
blank: "Select the most common type of unit at this location"
validations:

Loading…
Cancel
Save