Welcome to Giant Robots Smashing Into Other Giant Robots — a weblog about development, business, design and technology — written by thoughtbot.
what, is it good for? absolutely nothing
Ever write this?1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
before_filter :csv?, :only => :index def index respond_to do |format| format.html { @users = User.all } format.csv { @users = User.to_csv } end end def csv? if request.format == :csv && ! logged_in? log_in end end |
1 2 3 4 5 |
def csv? if request.format.csv? && ! logged_in? log_in end end |
Introducing What
What is a plugin that automatically adds those nice query methods to ActionController::Mime::Type, the type of object returned by Request#format. All the built in mime types are supported. Any custom mime types that you add will also have corresponding query methods.
About this entry
You're reading an entry on GIANT ROBOTS SMASHING INTO OTHER GIANT ROBOTS, the company weblog of thoughtbot, inc.
- Author:
- Jared Carroll
- Published:
- February 22nd 01:42 PM
- Updated:
- February 22nd 01:42 PM
- Sections:
- Development Technology
thoughtbot is hiring
We are hiring web developers and web designers in both Boston and New York, NY.
What are we up to?
We built Shoulda, an eclectic set of additions to Test::Unit; Paperclip to manage uploaded files without hassle; Jester, a REST/ActiveResource client library written in Javascript, and Squirrel, an enhancement for ActiveRecord's find syntax; — amongst some other projects.

Chad (President) and Jon (CTO) co-authored a technical book titled Pro Active Record: Databases with Ruby and Rails, which explores the ins and outs of the ActiveRecord ruby library. You can buy it today at Amazon.com.
About thoughtbot, inc.
We are a small web application development consulting business, with offices in Boston, MA and New York, NY. If you're looking to find a team for your next web development project or your new web application — get in touch.
3 comments
Jump to comment form