Permalink
Browse files

Deprecated warning in the README

  • Loading branch information...
1 parent d111e93 commit c4ebad8b19286c20eec7b861e2a3f54f24fb72a3 @mike-burns mike-burns committed Jun 3, 2011
Showing with 87 additions and 82 deletions.
  1. +0 −82 README
  2. +87 −0 README.rdoc
View
82 README
@@ -1,82 +0,0 @@
-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
View
87 README.rdoc
@@ -0,0 +1,87 @@
+= DEPRECATED
+
+This plugin is now deprecated. If you would like to dispatch on the MIME type
+from within a Rails controller you should use the {#respond_to}[http://api.rubyonrails.org/classes/ActionController/MimeResponds/ClassMethods.html#method-i-respond_to] method or the
+{mobile_fu}[https://github.com/brendanlim/mobile-fu] plugin.
+
+= 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}[https://github.com/thoughtbot/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

0 comments on commit c4ebad8

Please sign in to comment.