CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Fri, 22 Aug 2025 07:53:58 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090905061619
location: https://web.archive.org/web/20090905061619/https://github.com/thoughtbot/what/tree
server-timing: captures_list;dur=0.766154, exclusion.robots;dur=0.025760, exclusion.robots.policy;dur=0.010498, esindex;dur=0.013210, cdx.remote;dur=12.084356, LoadShardBlock;dur=126.920613, PetaboxLoader3.datanode;dur=43.007616, PetaboxLoader3.resolve;dur=33.950476
x-app-server: wwwb-app224
x-ts: 302
x-tr: 188
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app224; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Fri, 22 Aug 2025 07:53:58 GMT
content-type: text/html; charset=utf-8
content-length: 111
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sat, 05 Sep 2009 06:16:18 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
x-archive-orig-x-runtime: 31ms
location: https://web.archive.org/web/20090905061619/https://github.com/thoughtbot/what/tree/master
x-archive-orig-cache-control: no-cache
x-archive-orig-content-length: 111
cache-control: max-age=1800
memento-datetime: Sat, 05 Sep 2009 06:16:19 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 04 Oct 2008 09:59:22 GMT", ; rel="prev memento"; datetime="Mon, 16 Feb 2009 13:30:54 GMT", ; rel="memento"; datetime="Sat, 05 Sep 2009 06:16:19 GMT", ; rel="last memento"; datetime="Sat, 05 Sep 2009 06:16:19 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_11_20090905050154_crawl101.gpg-c/52_11_20090905061445_crawl101.arc.gz
server-timing: captures_list;dur=0.526298, exclusion.robots;dur=0.019621, exclusion.robots.policy;dur=0.008648, esindex;dur=0.010328, cdx.remote;dur=18.976621, LoadShardBlock;dur=205.141714, PetaboxLoader3.datanode;dur=66.610789, PetaboxLoader3.resolve;dur=225.558849, load_resource;dur=110.906759
x-app-server: wwwb-app224
x-ts: 301
x-tr: 371
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Fri, 22 Aug 2025 07:53:59 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Sat, 05 Sep 2009 06:16:19 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "15dbc1c44a09a2248b791f6d75e2826c"
x-archive-orig-x-runtime: 249ms
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-content-length: 22639
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sat, 05 Sep 2009 06:16:19 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sat, 26 Apr 2008 22:07:48 GMT", ; rel="prev memento"; datetime="Fri, 17 Apr 2009 05:52:46 GMT", ; rel="memento"; datetime="Sat, 05 Sep 2009 06:16:19 GMT", ; rel="next memento"; datetime="Wed, 14 Nov 2012 19:00:43 GMT", ; rel="last memento"; datetime="Wed, 14 Nov 2012 19:00:43 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_11_20090905050154_crawl101.gpg-c/52_11_20090905061445_crawl101.arc.gz
server-timing: captures_list;dur=1.633467, exclusion.robots;dur=0.022354, exclusion.robots.policy;dur=0.009628, esindex;dur=0.011722, cdx.remote;dur=7.808117, LoadShardBlock;dur=260.756085, PetaboxLoader3.resolve;dur=235.509595, PetaboxLoader3.datanode;dur=116.106870, load_resource;dur=115.021624
x-app-server: wwwb-app224
x-ts: 200
x-tr: 439
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
thoughtbot's what at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Adds boolean instance methods for MIME type checking to Rails edit |
Homepage: | edit |
Public Clone URL: |
git://github.com/thoughtbot/what.git
Give this clone URL to anyone.
git clone git://github.com/thoughtbot/what.git
|
Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:thoughtbot/what.git
|

jcarroll (author)
Fri Feb 22 12:07:16 -0800 2008
what /
name | age | message | |
---|---|---|---|
![]() |
MIT-LICENSE | Loading commit data... ![]() |
|
![]() |
README | ||
![]() |
Rakefile | ||
![]() |
init.rb | ||
![]() |
install.rb | ||
![]() |
lib/ | ||
![]() |
tasks/ | ||
![]() |
test/ | ||
![]() |
uninstall.rb |
README
What ==== What provides boolean query methods on Mime::Type instances for the native Rails mime-types. You now have these methods available from your controllers: request.format.atom? request.format.css? request.format.csv? request.format.html? request.format.ics? request.format.js? request.format.json? request.format.multipart_form? request.format.rss? request.format.text? request.format.url_encoded_form? request.format.xml? request.format.yaml? ... and any custom mime types that you add in any environment specific config files. Examples ======== # config/initializers/mime_types.rb Mime::Type.register 'text/iphone', :iphone # app/controllers/what_controller.rb class WhatController < ApplicationController before_filter :csv?, :iphone? def index render :text => 'index' end protected def csv? if request.format.csv? redirect_to login_url end end def iphone? if request.format.iphone? redirect_to login_url end end end What is especially powerful in combination with When. # app/controllers/what_controller.rb class WhatController < ApplicationController before_filter :login, :if => :csv? before_filter :login, :if => lambda { |controller| controller.request.format.iphone? } def index render :text => 'index' end protected def csv? request.format.csv? end def login redirect_to login_url end end Copyright (c) 2008 Dan Croak, Jared Carroll, and thoughtbot, inc. released under the MIT license
This feature is coming soon. Sit tight!