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: framework
Efficiently Incrementing Model Attribute Values
Imagine you have a collection of links, and you’re tracking views–you want to easily increment the number of views every time someone clicks on the link. How can you do this? We discuss a number of approaches, from saving the model instance to updating the attribute to using the increment and decrement functions. Continue reading
Using SQL for complex SELECT/ORDER Criteria
How can you select model objects using a complex SQL criterion (such as ordering by a SUM of values)? The answer is to use the find_by_sql method. You can select complex fields, join tables, and sort on those fields–such as sum fields. Continue reading