0

let's say we have a model called Student and it has a string field "name". There is wired requirement from the customer that all the student's name should consist of upper case letter. I think it's better to give the user the freedom to choose "upper" style input or "lower" style input and let the server side, in my case ROR to take this it consideration.

I guess it might be possible to add some hook function before a record be saved and in the hook function onecan implement the "lower" to "upper" convertion logic. Yes, I just make a bold guess So if you know other way to solve my problem, please di tell me your way. Thanks in advance.

1
  • And what would you do with a name such as "de Wit"? Commented Dec 15, 2010 at 11:17

1 Answer 1

2

http://guides.rubyonrails.org/active_record_validations_callbacks.html#callbacks-overview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.