Profile

Cover photo
Alex Chaffee
Attended Reed
Lives in San Francisco
299 followers|13,996 views
AboutPostsPhotosYouTube
People
Have him in circles
299 people
Jingting Wang's profile photo
Ed White's profile photo
Nick Chaffee's profile photo
Ben Curren's profile photo
Michael Corr's profile photo
Phuong Palmares's profile photo
Always Best Care Senior Services's profile photo
Alex Rosenberg's profile photo
Brian Jenkins's profile photo
Work
Occupation
Coder
Employment
  • Teacher, present
  • Railsbridge
    Volunteer, 2009 - present
  • Coder, present
  • EarthWeb
    Director of Engineering, 1995 - 1998
  • jGuru
    Guru, 1999 - 2001
  • Pivotal Labs
    Coach, Director of Systems
  • eBay
    Consultant
  • Google
    Consultant
  • Cohuman
    CTO, Founder, 2008 - 2010
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
San Francisco
Previously
Vermont - Burlington - New York City - El Paso - Portland - San Francisco - Paris
Story
Bragging rights
co-created Pivotal Tracker; designed Gamelan, the Java directory; coded & cofounded cohuman.com
Education
  • Reed
  • UVM
  • Oberlin
Basic Information
Gender
Male

Stream

Alex Chaffee

commented on a video on YouTube.
Shared publicly  - 
 
"You're detaining traffic...!"
1
porta potties's profile photo
 
You're the literal downfall of the entire world, I say this because after he said that he immediatly corrected himself. But your obviously the smartest man/woman alive and would like to share your knowledge about a man/woman's mistakes, thanks bro!
Add a comment...

Alex Chaffee

Shared publicly  - 
1
Add a comment...

Alex Chaffee

Shared publicly  - 
1
Alex Chaffee's profile photoAndrew Peterson's profile photo
3 comments
 
Well, the idea is that the client can ask for json, or xml or html, and your format block is listed in priority order. The first one that matches will be the one that is returned, and others will be short circuited. The simple if doesn't record the fact that, yes, we handle the html format.

Yes, you could do this with an `if/elsif/elsif/else` block. It would need to be:
```
if request.format.json?
  render blah:@foo.to_json
elsif request.format.html?
  # just render the view 
else
  # whatever
end
```

That being said, I'm on your side. I've gone away from using the `respond_to` block. I'm not sure what Rails gives you is all that valuable in many cases, and certainly most people don't understand what's going on. Requests these days are pretty much one format.

I almost always use the if statement like you show, or if I only support one format, hard-code it. Otherwise you have extra code paths that aren't tested, and I get alerts in the middle of the night as someone is "hacking" the website with different mime types.
Add a comment...

Alex Chaffee

Shared publicly  - 
1
Add a comment...
Have him in circles
299 people
Jingting Wang's profile photo
Ed White's profile photo
Nick Chaffee's profile photo
Ben Curren's profile photo
Michael Corr's profile photo
Phuong Palmares's profile photo
Always Best Care Senior Services's profile photo
Alex Rosenberg's profile photo
Brian Jenkins's profile photo

Alex Chaffee

commented on a video on YouTube.
Shared publicly  - 
 
"making money off their own incompetence" -- too true
1
Add a comment...

Alex Chaffee

commented on a video on YouTube.
Shared publicly  - 
 
I just played this video and Abby jumped in my lap to look at the screen. Very interesting!
1
Add a comment...

Alex Chaffee

Shared publicly  - 
1
Michael Hartl's profile photoBrian Hill's profile photoAlex Chaffee's profile photo
4 comments
 
Yeah, I'm not planning on emigrating just yet; I was impressed by the article's art and wit.
Add a comment...

Alex Chaffee

Shared publicly  - 
 
BgPatterns is a tiny web app for making background patterns in a few clicks. It was created mostly for fun and experimentation by Sergii Iavorskyi. Feedback is welcome. Project Updates. In time new fe...
1
Add a comment...

Alex Chaffee

Shared publicly  - 
 
I have to ask a question to my fellow Rubyists out there? Why are you still using YAML? I know why you think you like YAML. You think it’s a great way to write configuration files, but it’s really not. You know what’s a great way of writing configuration files for Ruby apps? RUBY! I know it’s crazy, isn’t it? But why not? Why would you not want to use Ruby for configuring your applications instead of YAML? I’m the maintainer of a pretty popular c...
1
Add a comment...