June 2007
9 posts
route it, route it, route it out loud
Do you have to test your routes? Yes. There’s no reason you shouldn’t be automating the testing of your routes. The alternative would be to open up a browser and type in each pretty url, that’s no good. How do you test them? There’s basically 2 ways I’ve tested routes. 1.) Create a separate test file just for routes: test/functional/routes_test.rb require File.dirname(__FILE__)...
Jun 27th
4 tags
Launch: Nature Precedings
We’re pleased to announce the launch of Nature Precedings – a preprint server operated by Nature Publishing Group. thoughtbot has been involved as a product development partner since precedings was still in the concept stage. It’s been great to work with Timo, Nicole, Hilary, Tom and everyone else at Nature who are genuinely passionate about what they do and about wanting this project to succeed...
Jun 21st
1 note
An Addition to the Team: Introducing Jason
We’re happy to announce that a few weeks ago, we had Jason Martinez join the thoughtbot team as Lead Designer. At thoughtbot, we’ve always been very opinionated, and our standards have been very high for user interface design, as well as the quality of our CSS and HTML markup. Matt, myself, and the rest of the team, along with our partners have been able to deliver excellent results. However,...
Jun 20th
1 tag
fist in your facebook
Here at t-bot, we just finished porting a part of one of our existing Rails applications to utilize the new Facebook platform. It took about a week, and despite the decent documentation for the Facebook platform, there was definitely a lot of trial and error. There also seems to not be a lot of resources on using Rails and the Facebook platform, so we thought we’d give back what we learned. ...
Jun 14th
1 tag
Jester 1.3: Jsonic REST
Whew, it’s been a while. The most requested feature for Jester has been JSON support, and that’s what this release delivers. Let’s get right to it. Jester is available from SVN in trunk form, or a 1.3 release form. You can also download a zipped copy of 1.3. Jester is released under the MIT License. Using JSON in Jester is easy. Set the “format” option when defining your model, and JSON...
Jun 11th
she's a beauty
Recently I was writing an action in one of my controllers that needed to do a POST to a remote API. One of the parameters in that POST was a block of HTML. The first pass was similar to this (ignoring execption handling for the remote call for now): class UsersController < ApplicationController def create @user = User.new params[:user] if @user.save markup...
Jun 8th
null ain't false
This one come up today at the shop. Say you have the following table: users (id, admin) And its got a couple rows in it (1, 1) (2, 0) (3, 1) (4, NULL) Now we want to find all non-admin users. class User < ActiveRecord::Base end User.find :all, :conditions => 'admin = false' What rows will that return? (2, 0) It doesn’t include: (4, NULL) ...
Jun 7th
1 note
2 tags
Features and Bugs Addendum
I was inspired by both Jared’s previous post and the Ruby Quiz for last Friday and wrote my FizzBuzz using the Open-Closed principle. Here’s the main program: # fizzerbuzzer.rb class FizzerBuzzer def self.filters @filters ||= [] end Dir.glob("*_filter.rb").sort.each{|f| require f } def self.filter(i) filters.collect do |filter| filter.filter(i) ...
Jun 4th
1 note
features and bugs
While attending RailsConf a few weeks ago the first non-keynote session I saw was my favorite and was also the reason I decided to go to the conference in the first place. It was the legendary Uncle Bob Martin; if you ever get a chance to attend one of his sessions definitely check it out, very entertaining and someone that would be awesome to work with. His talk wasn’t about Rails, it was about...
Jun 1st