14 Apr '12, 12pm

Riding Rails: Three reasons to love ActionController::Responder:

Three reasons to love ActionController::Responder Posted by José Valim , August 31, 2009 @ 10:02 am A couple weeks ago, I wrote about the newly added ActionController::Responder which summarizes your application behavior for a specified format in just one place. For example, the default html behavior is written as: class ActionController::Responder def to_html if get? render elsif has_errors? render :action => (post? ? :new : :edit) else redirect_to resource end end end Here are three examples of the flexibility this new layer can provide. 1) HTTP Cache A simple, but quite powerful use for responder is apply HTTP cache to all your resources easily. For simplicity, let's cache just get requests that are not handling a collection: module CachedResponder def to_html if get? && resource.respond_to?(:updated_at) return if controller.fresh_when(:last_modified => resource.updated...

Full article: http://weblog.rubyonrails.org/2009/8/31/three-reasons-lov...

Tweets

Love these!!!

coach.com 21 Apr '12, 5pm

Love this:

sprudge.com 25 Apr '12, 6pm

A @studiotmlsbr rocking internacionalmente! Love it

A @studiotmlsbr rocking internacionalmente! Lov...

solestruck.com 15 Apr '12, 4am

I LOVE LOVE LOVEEEE this shoe. The 6.5 inch heel is sooo sexy and the quality is impeccable. I wear a 8.5, but bought a 9 ...

6 Reasons to Start Cross-Country Running #running

6 Reasons to Start Cross-Country Running #running

runaddicts.net 15 Apr '12, 12pm

Interested in writing for RunAddicts.net? Get started now! If you’re a road runner, it’s time to try something new to jazz...

Have you ever heard this? 4 Reasons Why the 301...

seo.com 15 Apr '12, 7am

I do not agree that it is a smart business practice to go and not care if your client is given using a 301 redirect and bu...

day three

day three

fashiontoast.com 17 Apr '12, 6am

Yesterday was hands down the best day of the festival, perfect weather and the most insanely good performance of the weeke...

Three dead, 33 wounded in Philippine bombing

channelnewsasia.com 14 Apr '12, 3pm

COTABATO, Philippines: Three people were killed and 33 others wounded after a man hurled a grenade into a cockfighting are...

What's New in Edge Rails #17 via @zite

afreshcup.com 16 Apr '12, 11am

A Fresh Cup is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting i...

OMG I LOVE YOU SATURDAY NIGHTl

OMG I LOVE YOU SATURDAY NIGHTl

solestruck.com 22 Apr '12, 6am

5 1/4" heel and 1 3/4" platform. Leather upper, lining and sole. Fits small. Recommend ordering up one whole size. Size US...

Three Questions To Ask When Selecting An Enterprise SEM Tool Provider

Three Questions To Ask When Selecting An Enterp...

searchengineland.com 12 Apr '12, 4pm

Having just experienced a round of demos from some of the major enterprise PPC tools, I can’t help but love my job. It’s a...

3 reasons women should gain lean muscle

sg.news.yahoo.com 16 Apr '12, 7am

At Genesis Gym , education is one of the most important things that we try to help clients with. Education leads to better...

Food of love: why 'aphrodisiac' oysters could be the sustainable alternative to meat

Food of love: why 'aphrodisiac' oysters could b...

theecologist.org 12 Apr '12, 3pm

It started as a roadside tea shack in 1988 but today Loch Fyne Oysters is a cluster of businesses supplying seafood to Bri...