Archives

Code reviewing as a mindset

Code reviews are more than proper indentation and method length. They're about understanding your software, and developing a better team of developers. Here's my approach to the code review practice. (January 16, 2017)

Going HTTPS-only in Rails with Let's Encrypt

Serving your Rails application over HTTP? Starting this month, your users may start receiving security warnings when visiting your site. Protect their safety and privacy quickly and easily with Let's Encrypt. (January 09, 2017)

Everyday Git: Search the git log from the command line

Your project's git log can tell you stories, but you have to know how to look for them. Here's how I explore a code base's history, using built-in command line tools. (January 02, 2017)

Rails security essentials

Rails provides excellent support for software security, but you need to know how and when to apply those supports for them to work. Here's an overview of tools you can use to keep your applications safe. (December 12, 2016)

Updates to Everyday Rails Testing with RSpec for Rails 5 and RSpec 3.5

A big update to my testing book is coming in 2017. Here's a list of things to expect in the new edition. (December 05, 2016)

Replacing RSpec controller specs, part 2: Feature specs

In part two of a series on ditching controller specs, let's move a complicated controller example into a more reasonable, future-proof feature spec. (September 05, 2016)

Replacing RSpec controller specs, part 1: Request specs

Does your application's test suite rely heavily on controller specs? It's time to consider alternatives, as controller testing has changed in Rails 5. Here's one way to replace a common use of these specs, even if you haven't upgraded to Rails 5 yet. (August 29, 2016)

Improving Rails application documentation

I've been thinking about how to improve the quality of Rails code bases through better documentation practices. Here are some steps I'm taking in my own projects. (April 18, 2016)

Clearance: The other Rails authentication gem

Looking for a well-balanced authentication solution? Check out Clearance as an alternative to Devise and has_secure_password. (January 23, 2016)

Using RSpec in Atom

I love how extensible GitHub's Atom editor is. Here are some useful packages for using it to edit and run RSpec tests. (August 27, 2015)

Everyday Rails redesign for 2015: Initial notes and reflections

A behind-the-scenes look at the tools and decisions that led to the first major redesign of Everyday Rails in three years. (August 09, 2015)

Cloning Active Record objects and their associates with Deep Cloneable

Here's how I created sanitized sample data from real-world data, using a few lines of Ruby code and a very useful gem. (July 29, 2015)

How do assigns and reload work in Rails tests?

Rails offers a couple of methods to access persisted test data, but how do they work? Let's get some answers, with the help of Pry. (April 05, 2015)

Automating code review with Pronto (and friends)

Pronto helps streamline the code review process by automating what can be automated, so you can focus on the code's intent and design. Here's one example of how to use it. (February 17, 2015)

Switching from Selenium to Poltergeist in RSpec feature specs

A quick one, for readers of my RSpec book: Moving to a headless driver for faster JavaScript testing with Capybara. (January 27, 2015)

Simple data transfer with YamlDB

Ever need to transfer data from one database to another? Here's a solution that worked for me. (December 23, 2014)

Everyday Rails Testing with RSpec now updated for RSpec 3

RSpec 3.1, Rails 4.1 (and beyond), testing services, and more: Here's what's new. (October 05, 2014)

Everyday Rails Testing with RSpec: Upcoming updates for 2014

It's getting time for the book's annual-ish update. Here's a look at what's planned for the next version. (April 03, 2014)

Everyday Git: Clean up and start over

Git makes it easy to experiment with ideas before committing them for posterity. Here's one way to get rid of those experiments when they go bad. (February 27, 2014)

Japanese translation of Everyday Rails Testing with RSpec

A Japanese version of my testing book is now for sale on Leanpub. (February 08, 2014)

Looking for the Rails 3.2 edition of Everyday Rails Testing with RSpec?

The previous edition of my book is now a free extra with all purchases of the current edition. (January 25, 2014)

A great example of outside-in testing from Ruby Tapas

How do you turn testing knowledge into a testing habit? Learn from an expert. (January 15, 2014)

I wrote a view spec

When is it beneficial to include a view spec in your Rails app's test suite? Here's one example. (November 15, 2013)

Chinese translation of Everyday Rails Testing in RSpec now available

A Chinese version of my testing book is now for sale on Leanpub. (September 09, 2013)

Testing with RSpec for Rails 4 is done

Information on the final release, and a note on what's up next. (August 21, 2013)

Everyday Rails Testing with RSpec: Where are the Rails 4.0 updates?

Updated development schedule for all who've purchased my RSpec book. Short answer: They're coming! (July 16, 2013)

Obfuscating data in Rails applications for screenshots and demonstrations

Faker isn't just for testing; here's how I used it to use real data in demonstrations (without revealing anything sensitive). (May 20, 2013)

Everyday Rails Testing with RSpec: Updates for April, 2013

Wrapping up Rails 3.2 and looking ahead to Rails 4.0. (April 24, 2013)

Diary of a Rails rescue project, part 2: Testing

Notes on using tests to learn about legacy software. (April 16, 2013)

Diary of a Rails rescue project

Notes from the field as bring a long-neglected Rails application up to speed. (March 21, 2013)

Everyday Rails Testing with RSpec, the book now covers Capybara 2.0, RSpec's new syntax, and more

The next round of updates to my introduction to testing in Rails is here! (February 13, 2013)

Everyday Rails Testing with RSpec: News and update plans

Updates to the Rails testing toolkit I use in the book are on the way (or here already). Here's my plan for addressing these changes. (November 14, 2012)

Bundler tip: Always specify gem versions

Don't make future developers (or future you) guess your application's dependencies. Tell Bundler how to load the right gems every time. (September 11, 2012)

Creating a Rails admin panel from scratch, part 3: Other resources

In the final part of this series, we'll create a fresh controller and views to manage an ActiveAdmin resource within our namespaced admin panel. (August 19, 2012)

Creating a Rails admin panel from scratch, part 2: Scaffolded resources

In part two of the series, we'll take a look at moving a scaffold-generated resource into our custom admin panel. (August 07, 2012)

August 2012 updates for Everyday Rails Testing with RSpec

Anyone who's purchased my book should head over to Leanpub to download the latest version. Here's a list of what's new. (August 03, 2012)

Creating a Rails admin panel from scratch, part 1: The dashboard

Add-ons like ActiveAdmin and RailsAdmin are both solid solutions for building feature-rich administration systems for Rails applications, but what if you want a more custom solution? In this series we'll cover the test-driven development of a namespaced admin solution built just for your application. (July 31, 2012)

Everyday Rails Testing with RSpec: The Book is complete

The expanded version of my series on learning to test is ready for non-early adopters. Here's more information on the Rails 3.2 version of the book, and what's to come later. (June 13, 2012)

Update on the RSpec book

I've been busy completing the book and incorporating your feedback. Here's where things stand at the moment, along with answers to some questions I've received. (May 15, 2012)

Everyday Rails Testing with RSpec: Get advance access to my new book now

I'm happy to announce that the extended, DRM-free ebook version of my RSpec series is now available for purchase through Leanpub. Here's a rundown of what's there now and what's to come. (May 07, 2012)

How I learned to test my Rails applications, Part 5: Request specs

Integration testing with RSpec request specs make sure your application's various parts are working in cohesion. Here's a primer on getting started. (April 24, 2012)

How I learned to test my Rails applications, Part 4: Controller specs

Controllers are the glue in a Rails application, and should be tested just like any other code. This primer will guide you to better coverage in your own apps' controllers. (April 07, 2012)

How I learned to test my Rails applications, Part 3: Model specs

How can you make sure your application's core building blocks are doing what you expect them to? Let's start by using RSpec to test model functionality. (March 19, 2012)

How I learned to test my Rails applications, Part 2: Setting up RSpec

Our series on getting comfortable with Rails testing continues as we set up RSpec for an existing application. (March 12, 2012)

How I learned to test my Rails applications, Part 1: Introduction

Are you still wrapping your head around Rails testing techniques? Here are the tools and techniques that helped me go from zero to decent test coverage. (March 12, 2012)

More advice on legacy data migration in Rails

What do you do if your legacy data defies convention or is just generally complex? Here are some notes from my recent experience using rake to accomplish difficult data migrations. (December 11, 2011)

How I've been developing an administrative backend with ActiveAdmin

Rails developers with deadlines will love ActiveAdmin for building high-quality interfaces for managing a site's data. (November 11, 2011)

Authorization advice for Rails 3 and beyond

Here's the general process I follow whenever adding authorization—the logic that says what a user's allowed to do—to my Rails applications. (October 06, 2011)

Rails authentication today: Options for 3.0 and 3.1

There's no shortage of approaches to adding password-based security to your Rails applications. Here's a look at the current lineup. (September 21, 2011)

Migrate data to Rails applications with Trucker

Get legacy data? Trucker makes moving it from old codebases into new Rails apps with relative ease. (September 16, 2011)

MailForm: Easy e-mail contact forms for your Rails apps

Get e-mail feedback from your site's visitors though this simple-to-implement web form. (September 07, 2011)

Simple, user-friendly cancel links for your Rails forms

Let your users opt out of a form and return to the page they came from with this simple helper. (June 16, 2011)

Better SMTP handling in Rails application development

You don't need to send out e-mail messages to real addresses during development with these two easy-to-use options for SMTP handling. (May 26, 2011)

Install Rails 3.1 beta with RVM gemsets (a public service announcement)

Don't forget, RVM gemsets are great for trying out pre-release versions of Rails without interfering with other work. Here's a reminder on how to set that up. (May 08, 2011)

try(), try() again in Rails

The very convenient try() method has been available to Rails developers since version 2.3, but it's easy to forget if you're not in the habit of using it. Here's a brief primer. (April 28, 2011)

Simple Rails site backups

How do you back up production data for your Rails projects? A new gem called Backup may be all you need. (April 03, 2011)

Obfuscated URLs with the FriendlyId gem

SEO-friendly URLs are great, but what if you want to obfuscate things a bit? Here's a proof of concept of one way to get the job done with the FriendlyId gem. (March 11, 2011)

Application templates in Rails 3

Here are some thoughts on bootstrapping Rails 3 apps with customized templates. (February 28, 2011)

Passenger 3, RVM, and Apache; quick and easy

If, like me, you've been dragging your feet about upgrading to Passenger 3, stop waiting. In this post I'll quickly walk through using it with RVM for Rails development. (January 25, 2011)

Learning Ruby and Rails

There's been a lot of conversation recently about the best ways to get started with Ruby. Here's my take on the subject, based on how I learned Ruby back in 2005 and what I'd do differently today. (January 19, 2011)

Beginning Rails testing

Still not writing tests for your Rails applications? Here are a few suggestions from my own experiences to get you started. (January 11, 2011)

Turnkey administration interface for your Rails apps

RailsAdmin gives you a rich, web-based interface to your Rails 3 application's data in minutes. Here's how to get started. (December 17, 2010)

Clean, search-friendly URLs for your Rails applications

Finding objects by nice-looking, search engine-friendly string parameters instead of the default object ID is easy with these Ruby gems. (December 07, 2010)

Trees and taxonomies with Ancestry

Ancestry is a new gem for adding tree structures to content in your Rails applications. (November 16, 2010)

jQuery Mobile, Rails, and Devise

jQuery Mobile is easy to integrate with Rails and Devise to create authenticated, mobile-friendly web applications. (November 09, 2010)

3 Rails documentation tools

Even in Rails, documenting your code is important. It's also pretty easy with these tools. (October 16, 2010)

3 Rails refactoring tools

Refactoring a Rails project can be a daunting task for new developers. Here are three tools to help ease the pain. (September 27, 2010)

RVM and project-specific gemsets in Rails

Take advantage of RVM's gemset feature to create project-specific gem installations for your Rails applications. (September 13, 2010)

Mobile Rails applications, part 2: jQTouch with Rails 3

Continuing on my project to build a mobile-friendly Rails application, here's a look at making the jQTouch mobile framework talk to your Rails application. (August 29, 2010)

Mobile Rails applications, part 1: An overview

Looking for the best way to make a mobile-optimized version of your website? Here are three resources to get you started, and a look at next steps. (August 22, 2010)

Parsing dates and times in Ruby and Rails

Make dates, times, and durations friendlier to users with Chronic and Chronic Duration, two must-have gems for Rails developers. (August 11, 2010)

More free Ruby and Rails books

Looking for more free books to get better at Ruby and Rails? Here are six more titles for your digital bookshelf. (August 04, 2010)

Use Nifty Generators in Rails 3

The very handy Nifty Generators gem works in Rails 3 with a few minor usage changes. (July 30, 2010)

Build a virtual bookshelf of free Ruby and Rails books

You don't need to spend a lot of money to build a reference collection for Ruby and Rails. Here are some free books to help you become a better Rails developer. (July 28, 2010)

Know your Rails command line tools

There's no getting around the command line when it comes to developing Rails applications. Here are several resources to help you get the most out of the Rails command line experience. (July 23, 2010)

Understanding REST and routes

These four tutorials will get you up to speed quickly on the ins and outs of RESTful routing in Rails. (July 18, 2010)

Nest routes through multiple controllers to DRY up your code

Want to nest an #index action under multiple parent scaffolds? It's actually pretty easy; this tutorial explains how. (July 13, 2010)

Authenticated attachments in Rails with Paperclip

Thoughtbot's Paperclip gem makes uploading files through web forms a breeze, but sometimes you need to keep those files protected from the general public. Here's how I require authenticated access to uploaded files in my Rails apps. Updated July 10, 2010. (July 08, 2010)

Moving from beginner to intermediate Rails development

So you've watched the podcasts, read the books, done the tutorials, and written your own Rails app. What's next? (July 05, 2010)

Stop procrastinating and install Rails 3 now with RVM

Worried about Rails 3 disrupting your workflow? Here's how I use RVM's gemsets feature to keep my day-to-day development environment and Rails 3 distinct. (June 28, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 3: Parent and child objects

Leverage your applications' model relationships to write complex, but clean, authorization rules. (June 24, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 2: Basic ACLs

Here's how to protect your application's data through an easy-to-apply access control layer. (June 21, 2010)

Even faster application bootstrapping with You've Got Rails

Build a full-featured template for your Rails applications with a few mouse clicks. (June 19, 2010)

Adding authorization to your Rails app with RESTful_ACL, part 1: Setup

Need easy-to-use authorization in your application? Check out this useful alternative to other, better known options. (June 16, 2010)

Debugging Rails apps with Rails Footnotes

Rails Footnotes is a must-have gem for Rails developers of all skill levels. Here's how to get started with this invaluable debugging tool. (June 10, 2010)

Hacking Restful Authentication

Edit user accounts and add administrator users to your legacy Rails apps using the popular Restful Authentication login system. (June 08, 2010)

3 Rails authentication options

It's almost inevitable that your Rails application will ultimately need some sort of login mechanism to protect access to certain parts. This post begins a series of looks at various options for authorization in Rails. (June 06, 2010)

Finding the best time-saving gems for your Rails app with Ruby Toolbox

How do you find the best gems to add features to your applications? Save a lot of search time with a new-ish index of Ruby gems. (June 03, 2010)

Building Rails apps faster with Nifty Generators, part 3: nifty_scaffold

Scaffolds are great when you're learning Rails, but the nifty_scaffold generator makes them effective timesavers when you're working on an app. (June 01, 2010)

Building Rails apps faster with Nifty Generators, part 2: nifty_config

Nifty Generators does more than just view-related code; here's an easy way to create a global config file for your app. (May 27, 2010)

Building Rails apps faster with Nifty Generators, part 1: nifty_layout

Nifty Generators make scaffolding in Rails an even more effective way to get your Rails app off the ground quickly. Here's how I use this handy gem to create a basic layout and stylesheet for my app. (May 25, 2010)

Bootstrapping Rails with an app template

Now that you've seen how I configure my Rails applications out of the gate, here's a way to do the same thing with one command. (May 22, 2010)

Bootstrapping a Rails application

The process of creating a new Rails application is straight from Rails 101, but there are a few steps you can add early on to help you code more efficiently down the road. (May 19, 2010)