method
custom
v2.1.0 -
Show latest stable
- Class:
ActionController::MimeResponds::Responder
custom(mime_type, &block)public
No documentation available.
# File actionpack/lib/action_controller/mime_responds.rb, line 123
def custom(mime_type, &block)
mime_type = mime_type.is_a?(Mime::Type) ? mime_type : Mime::Type.lookup(mime_type.to_s)
@order << mime_type
@responses[mime_type] ||= Proc.new do
@response.template.template_format = mime_type.to_sym
@response.content_type = mime_type.to_s
block_given? ? block.call : @controller.send(:render, :action => @controller.action_name)
end
end