module ActionController::Route::Builder
#
helpers for defining routes with strong parameters
Direct including types
ActionController::Base
Constants#
DEFAULT_PARSER = ["application/json"]#
by default applications expect to receive JSON
DEFAULT_RESPONDER = ["application/json"]#
by default applications respond with JSON
Macros#
add_parser#
add code that can be used to deserialise request bodies of the content-type provided
add_parser("application/yaml") do |klass, body_io, request|
request_charset = ActionController::Support.charset(request.headers)
body_io.set_encoding(request_charset) if request_charset
klass.from_yaml(body_io)
end
add_responder#
add a new responder for the content-type provided, this will be called to render responses
add_responder("application/yaml") { |io, result| result.to_yaml(io) }
default_parser(content_type)#
specify the default content-type of request bodies, if the user doesn't specify one
default_responder(content_type)#
specify the responder content-type to use if the user doesn't request one