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: launchpad
CSS Progress Bar
How can you create a progress-bar with pure CSS, no images? In this post, we discuss one such attempt by Launchpad–where we have a target article-count goal, which we display in the dashboard. And we use a progress bar that’s pure CSS. Continue reading
Rails 2.1: Named Scope
Rails 2.1 introduces something called named scopes; named scopes allow you to create named collections on a class-level for your models, such as Article.published. You can chain named scopes together, and even create parameterizable scopes by using the lambda keyword; you can pass in variables, of a sort, and Rails will plug the values into your named scope queries. Continue reading
Functions as First-Class Objects
A lot of programming languages have functions as first-class objects (you can pass them around, execute them, etc.) Ruby has some sort of functionality like that (proc and functors and yield, oh my!), but there’s a simpler solution: the (albeit abusable) eval method. Continue reading
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
Page Rendering Time
A lot of websites show the page rendering time at the bottom. How can we implement this in our Rails website? We discuss a simple approach, where you wrap between two calls to Time.now (to get the current time). Subtracting them yields the time difference, in fractional seconds. Continue reading