everydayrails.com Archives - 25 December 2012, Tuesday

The Rails ecosystem moves quickly–too quickly, some might say–and as a result a given library’s API from just a few months ago may be deprecated today–or worse, it may just no longer work. Running bundle install with the Gemfile as-is, I could get gem versions that are no longer compa...

Behind the scenes, I’ve built a simple little blogging application with an articles scaffold and an authentication system. See Authentication from Scratch (Revised) from Railscasts (subscription required) to see the basic approach I followed to set up logins for the application. One p...

Related:

I actually got started by learning how to create generators in Rails 3 (used to create custom code in an existing Rails application), then extended that to Rails templates (used to create new Rails applications, pre-baked with my favorite gem installations and other tweaks). The best ...

I live in a town dominated by Python, PHP , and Java developers, so hiring someone who can come in and write Ruby code from day one is a challenge. I’ve been thinking about how I learned Ruby myself, how I’ve gone about helping others learn it, and what I would do differently if I had...

Everyday Rails Testing with RSpec: The Book is complete June 13, 2012 On Monday I posted the final, edited version of Everyday Rails Testing with RSpec , available now on Leanpub for $9 US. First, let me again thank everyone who purchased the early access, beta version of the book. I ...

? I mean it’s not done yet, but I wanted to go ahead and get the book out there for people to start reading. (If you’ve ever purchased a beta book from Pragmatic Programmers you know what I’m talking about.) I’ve got updated versions of the original RSpec articles from this blog in pl...

Rails authentication today: Options for 3.0 and 3.1 September 21, 2011 Early on in Everyday Rails , I outlined three options for adding authentication to your Rails applications . It’s still a popular subject—and with two major releases of Rails and a number of new authentication opti...

Keep it simple: If you don’t get request specs right away, don’t worry about it. They require some additional setup and thinking to not just work, but actually test what you need to test. Don’t stop testing your models and controllers, though—building skills at that level will help yo...

Related:

lets you call methods on an object without having to worry about the possibility of that object being nil and thus raising an exception. I know I sometimes forget about it, and I’ve looked at enough code from other developers to know that I’m not the only one. So today I’d like to giv...

If you’re just getting into Ruby or Rails now, and looking for some light reading, you’re in luck. Publishers like the Pragmatic Programmers, O’Reilly, Manning Publications, and others have tons of books available to help you learn. You could easily spend a few hundred dollars buildin...

Controllers are models too, as Piotr Solnica indicated in an excellent blog post . And in Rails applications, they’re pretty important models—so it’s a good idea to put them on equal footing, spec-wise, as your Rails models. Controller specs can be written more quickly than their inte...

Related:

I won’t spend a lot of time bad-mouthing fixtures—frankly, it’s already been done. Long story short, there are two issues presented by fixtures I’d like to avoid: First, fixture data can be brittle and easily broken (meaning you spend about as much time maintaining your test data as y...

How I learned to test my Rails applications, Part 1: Introduction March 12, 2012 Ruby on Rails and automated testing go hand in hand. Rails ships with a built-in test framework; if it’s not to your liking you can replace it with one of your liking (as I write this, Ruby Toolbox lists ...

To start, I recommend reading through Jarod Santo’s excellent introduction to using jQuery Mobile with Rails 3 . It goes through the steps of integrating the mobile framework into a standard CRUD scaffold. However, to make your app both mobile and desktop-savvy, you’ll probably want t...

Everyday Rails is about using the Ruby on Rails web application framework to get stuff done as a web developer. Learn more. 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 rece...

Moving from beginner to intermediate Rails development July 05, 2010 I believe that Rails is an excellent way to get started on server-side web development. The framework provides a good structure that’s easy to understand, and provided you follow some fairly basic rules, you can have...