Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Error texts
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Apr 18, 2014
1 parent 73aa719 commit a753721
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/controllers/applicants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create
positions.each do |arr|
professor = arr.last[:professor_attributes]
existing = Professor.find_by_email(professor[:email])
Professor.create!(professor) unless existing
Professor.create(professor) unless existing
end

@applicant = Applicant.new(applicant_params)
Expand Down
2 changes: 1 addition & 1 deletion app/models/applicant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Applicant < ActiveRecord::Base
validate :static_identifier, on: :update
validates :phone_number, length: { minimum: 10 }
validates :email, presence: true, uniqueness: { case_sensitive: false },
format: { with: EMAIL_REGEX }
format: { with: EMAIL_REGEX, message: 'is invalid (only enter before the @ symbol)' }
validates :class_standing, on: :update, inclusion: { in: 0...Standing.names.count }
validates_presence_of :name
validates_presence_of :wuid
Expand Down
2 changes: 1 addition & 1 deletion app/models/professor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Professor < ActiveRecord::Base
validate :static_identifier, on: :update
validates_presence_of :name
validates :email, presence: true, uniqueness: { case_sensitive: false },
format: { with: EMAIL_REGEX }
format: { with: EMAIL_REGEX, message: 'is invalid (only enter before the @ symbol)' }

def to_param
identifier
Expand Down
2 changes: 1 addition & 1 deletion app/views/applicants/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="field">
<%# TODO: The email suffix get's put on a newline when there are errors %>
<%= f.label :email, class: 'sr-only' %><br>
<%= f.text_field :email , class: 'form-control', placeholder: 'Winthrop Username' %>
<%= f.text_field :email , class: 'form-control', placeholder: 'Winthrop Email' %><%= EMAIL_SUFFIX %>
</div>
<div class="field">
<%= f.label :wuid, class: 'sr-only' %><br>
Expand Down

0 comments on commit a753721

Please sign in to comment.