Mime::Type
class Mime::Type
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: @post } end end end
Constants
- PARAMETER_SEPARATOR_REGEXP
- TRAILING_STAR_REGEXP