Class

Type

Extends:

Encapsulates the notion of a mime type. Can be used at render time, for example, with:

class PostsController < ActionController::Base
  def show
    @post = Post.find(params[:id])

    respond_to do |format|
      format.html
      format.ics { render :text => post.to_ics, :mime_type => Mime::Type["text/calendar"]  }
      format.xml { render :xml => @people.to_xml }
    end
  end
end
Classes
AcceptItem A simple helper class used in parsing the accept header
Public Methods
==
===
lookup
lookup_by_extension
new
parse
register
register_alias Registers an alias that’s not used on mime type lookup, but can be referenced directly. Especially useful for rendering different HTML versions depending on the user agent, like an iPhone.
to_s
to_str
to_sym
Private Methods
method_missing
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.