How do other developers solve this problem?
I've found a very practical solution on the .NET side of things is to use data annotations with MVC - which allows you to markup your model with metadata describing the shape of acceptable data and have it automagically validated on both client and server - but haven't found anything similar in PHP and other languages. Any recommendations?
It does basically what you describe, but once you combine it with some other gems and add in some non-standard validations, it seems to get a bit unwieldy. I'm newish to rails but it makes me pine for Node.js, where I could literally just run the same validations on the client and server. Do any rails gurus know if this is best practice?
And what are the "non-standard validations"? If you are referring to custom validations that you wrote then you'll have to write the supporting javascript validation.