class Type
Ruby on Rails 7.1.6
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 body: @post.to_ics, mime_type: Mime::Type.lookup("text/calendar") }
format.xml { render xml: @post }
end
end
end
Inherits from
Namespace
Classes
Constants
Attributes
Methods (defined here)
- # ==
- # ===
- # =~
- # all?
- # eql?
- # html?
- # match?
- # ref
- # to_s
- # to_str
- # to_sym
- self. lookup
- self. lookup_by_extension
- self. new
- self. parse
- self. parse_data_with_trailing_star
- self. parse_trailing_star
- self. register
- self. register_alias
- self. register_callback
- self. unregister
Private methods (4)
Show private methods Implementation detail — not part of the public API.
- # method_missing
- # respond_to_missing?
- # to_a
- # to_ary
Used by
Subclasses (1)
Methods (inherited)
From Object
(17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options