Skip to content

Instantly share code, notes, and snippets.

@radar
Forked from EminenceHC/referrals_controller.rb
Created February 26, 2015 23:30
Show Gist options
  • Save radar/3b14c06f3346afde7719 to your computer and use it in GitHub Desktop.
Save radar/3b14c06f3346afde7719 to your computer and use it in GitHub Desktop.
def create
begin
params[:referral][:dob] = Date.strptime(params[:referral][:dob], '%m/%d/%Y')
rescue ArgumentError
# error goes here
end
@referral = Referral.new(referral_params)
if @referral.save
redirect_to confirmation_page_referrals_path, notice: "Thank you for submitting this referral to Eminence Healthcare."
else
render :new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment