While working on a functionality, I came across a situation where I was required to update the model which had a lot of validations specified. It is possible to update a single attribute and save the record without going through the normal validation procedure using update_attribute but when you need to do it for multiple […]Read more "Rails update attributes without validations"
jQuery makes playing with the DOM elements so easy and concise that its just not possible to think of any other approach. So as an example, if I wanted to select all checked radio buttons with their ids starting with ‘spec’ with value = ‘no’ $(“:input[id^=’spec’][value=’no’]:radio:checked”) For text fields, the usual way to access the […]Read more "jQuery – Playground"
Forms in rails let you show error messages when you create or update the records. In certain situations, I came across a weird issue where the error messages on the view were being shown in a strange format. I expected to see There were problems with the following fields: Name can’t be blank Instead it […]Read more "Ruby on Rails – Strange validation errors"
While working on some assignment in rails the other day, I came across a weird issue related with rails validations and re rendering of views upon actionrecord validation failure. The issue was composed of two parts. 1. Re rendering the form on validation check was messing the form layout. 2. Only IE was showing the […]Read more "Rails Validations – fieldWithErrors"