Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create #This action is to make the rot13 key to give access to the survey application
- if params.has_key?("commit")
- formdata = params.fetch("organization")
- formdata["signupip"] = request.remote_ip
- formdata["access_key"] = formdata["name"].crypt("o"+formdata["signupip"])
- formdata["contact_areacode"] = formdata["contact_areacode"].gsub(/[^\d]/, '')
- formdata["contact_areacode"] = formdata["contact_areacode"].gsub(/[^\d]/, '')
- begin
- Organization.create(formdata)
- flash[:message] = "Organization created! Your access key is <strong>#{formdata["access_key"]}</strong>.<br />This key has also been emailed to you at: #{formdata["contact_email"]}</strong>."
- rescue => e
- #handle error... (e.message returns the error in a string)
- flash[:notice] = "<strong>There was an error while signing up your organization.</strong><br />Please try again or contact us for assistance."
- end
- else # Show form, etc.
- end
- end
Add Comment
Please, Sign In to add comment