Adding dependent validations using jQuery Validate
While validating one of the many forms, I came accross a situation where a form field’s presence was dependent on another DOM element, depends
property of jquery-validate
plugin came to resue.
Dynamically modifying(read adding and removing) rules using jQuery validate
Got some hidden fields in a form which needs validation(at some later point say, when made visible)? Lets learn how to remove or add validation rules dynamically using jQuery Validate plugin.
Using gon in rails to pass data to javascript
Very often, I have come accross the situation where I need ruby variables in javascript file. Recently, I got to know about a wonderful gem gon which does the work for you. Lets see with an example.
Adding custom validations using jQuery Validate
I generally use jquery-validate
plugin for frontend validations. It comes with handful of validator methods. Sometimes we need custom validations. Lets see how to add one.
FactoryGirl with Non ActiveRecord Classes
Creating FactoryGirl
for ActiveRecord
classes is quite handy. Here we will learn creating FactoryGirl
for NonActiveRecord classes.
Working with click events in modals
If we have click events bound to elements inside a bootstrap modal, clicking on the element closes the modal. Here is a trick to prevent that.