Search
Categories
- Deployment (4)
- Development (63)
- Gems and Plugins (4)
- News (2)
- Projects (4)
- Testing (3)
Most Popular Tags
activerecord architecture collections css database date and time debugging design design patterns DRY ebooks fixtures floating-point numbers formatting framework front page global variables helpers I18n introductory launchpad meta-information migrations model multiplicity mvc MySQL partials production rails 2.0 rails 2.1 Rails 2.2 regular expressions routing rss ruby security setup sql UI upgrading user management validation xml xml builder
Tag Archives: validation
Drilling Down into Validation Failure
Rails provides model-level validation, which is easy and DRY. But if you have a class that validates multiple fields, how can you verify if validation is failing on the right fields? ActiveRecord provides a convenient errors method with an invalid? method you can call; it takes a field name. Continue reading
Validation 101
Data validation is crucial to web applications–especially e-commerce applications, where money is involved. Bad data can destroy the usefulness of (or even shut down) an application! What’s more, validation needs to be centralized–you want to keep your validation in one … Continue reading
When New Fails
Sometimes, you say @foo = Foo.new(…) and then @foo.save. But it doesn’t save! In fact, creating the new instance failed! What’s going on? One possibility is that @foo is nil (so it wasn’t created properly). Another possibility is that @foo.id is nil–which means @foo failed validation! Continue reading
Posted in Development
Tagged activerecord, debugging, introductory, new keyword, validation
Comments Off