Sunday, March 29, 2015

Client Side Validations Gems vs JQuery Libray in a Rails project

Client side validations gem has the following issues:

1. Browser compatibility is not known.
2. Radio buttons issue.
3. Document is not up to date for Rails 3.2.
4. Depends on persistence mechanism. Supports Mongoid, MongoMapper.
5. Custom validations still require writing javascripts.

Advantages of pure jQuery library approach:

1. Clean separation of UI logic from Mid-tier and Persistence tier.
2. Front-end developers can develop and test without any server-side coding. Faster.
3. Wide browser compatibility.
4. Upgrades are easier and not affected by Rails and Client Side Validation gem versions.
5. Simplicity. Rule based and less code to write, integrate, test and maintain.