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 class Location < ApplicationRecord
validate :validate_postcode validate :validate_postcode
validates :type_of_unit, :wheelchair_adaptation, presence: true validates :units, :type_of_unit, :wheelchair_adaptation, presence: true
belongs_to :scheme belongs_to :scheme
attr_accessor :add_another_location attr_accessor :add_another_location

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

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

8
config/locales/en.yml

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

Loading…
Cancel
Save