class Type
Ruby on Rails 8.0.4
Since v2.2.3Encapsulates 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)
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
From ActiveSupport::NumericWithFormat (2)
- # to_formatted_s
- # to_fs