diff --git a/app/models/contact.rb b/app/models/contact.rb index 091b5b7cd..05eb07764 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -2,7 +2,8 @@ class Contact include ActiveModel::Model attr_accessor :name, :email, :message - validates :name, :email, :message, presence: true + validates :name, :email, presence: true + validates :message, presence: true, length: {maximum: 500} # credit: https://medium.com/@limichelle21/building-and-debugging-a-contact-form-with-rails-mailgun-heroku-c0185b8bf419 end diff --git a/app/models/organization_account_request.rb b/app/models/organization_account_request.rb index 1d1eb659c..85b64b116 100644 --- a/app/models/organization_account_request.rb +++ b/app/models/organization_account_request.rb @@ -5,7 +5,7 @@ class OrganizationAccountRequest before_validation :normalize_phone - validates :name, :email, :city_town, :country, :province_state, presence: true + validates :name, :email, :requester_name, :city_town, :country, :province_state, presence: true validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i validates :phone_number, presence: true, phone: {possible: true, allow_blank: true} diff --git a/app/services/organizations/create_service.rb b/app/services/organizations/create_service.rb index 8a4f2ebfe..599bba598 100644 --- a/app/services/organizations/create_service.rb +++ b/app/services/organizations/create_service.rb @@ -1,11 +1,12 @@ -# class to create a new location, organization, user, and staff account with role admin -# email is sent to admin user if all steps are successful +# Class to create a new location, organization, user, and staff account with role admin. +# An email is sent to admin user if all steps are successful. +# Be sure to use the Country and State codes from countries_states.yml # call with Organizations::CreateService.new.signal(args) # sample args: # { # location: { -# country: 'Mexico', -# city_town: 'La Ventana', +# country: 'MX', +# city_town: 'JAL', # province_state: 'Baja' # }, # organization: { diff --git a/app/views/layouts/adopter_foster_dashboard.html.erb b/app/views/layouts/adopter_foster_dashboard.html.erb index bb4858c06..e6eaca4b3 100644 --- a/app/views/layouts/adopter_foster_dashboard.html.erb +++ b/app/views/layouts/adopter_foster_dashboard.html.erb @@ -121,11 +121,6 @@ Log Out <% end %> - diff --git a/app/views/organizations/adoptable_pets/index.html.erb b/app/views/organizations/adoptable_pets/index.html.erb index e2fc693ad..563459244 100644 --- a/app/views/organizations/adoptable_pets/index.html.erb +++ b/app/views/organizations/adoptable_pets/index.html.erb @@ -26,7 +26,7 @@
<%= f.label :sex_eq, "Sex" %> - <%= f.select :sex_eq, ["Male", "Female"], {include_blank: 'All'}, class: "form-select" %> + <%= f.select :sex_eq, [["Male", "male"], ["Female", "female"]], {include_blank: 'All'}, class: "form-select" %>
<%= f.label :breed_eq, "Breed" %> diff --git a/app/views/organizations/staff/pets/index.html.erb b/app/views/organizations/staff/pets/index.html.erb index 1c512133b..98df3b5f9 100644 --- a/app/views/organizations/staff/pets/index.html.erb +++ b/app/views/organizations/staff/pets/index.html.erb @@ -18,7 +18,7 @@
<%= f.label :sex_eq, "Sex" %> - <%= f.select :sex_eq, ["Male", "Female"], {include_blank: 'All'}, class: "form-select" %> + <%= f.select :sex_eq, [["Male", "male"], ["Female", "female"]], {include_blank: 'All'}, class: "form-select" %>
<%= f.label :species_eq, "Species" %> diff --git a/app/views/shared/_location_fields.html.erb b/app/views/shared/_location_fields.html.erb index 89da415c0..b01a2b4e9 100644 --- a/app/views/shared/_location_fields.html.erb +++ b/app/views/shared/_location_fields.html.erb @@ -21,5 +21,5 @@ } %> <%= form.text_field :city_town, - required: false, + required: true, class: "form-control" %>