Skip to content

Instantly share code, notes, and snippets.

@dhh
Created December 21, 2008 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dhh/38672 to your computer and use it in GitHub Desktop.
Save dhh/38672 to your computer and use it in GitHub Desktop.
case request.format
when :html then render
when :js then render
else head(:not_supported)
end
# vs
respond_to do |format|
format.html
format.js
end
@huobazi
Copy link

huobazi commented Jun 10, 2011

l like 'respond_do..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment