abstract class ActionController::Base

Included Modules

Defined in:

spec/curl_context.cr
action-controller/base.cr

Constant Summary

AFTER_MAPPINGS = {} of Nil => Nil

klass => {function => options}

AROUND_MAPPINGS = {} of Nil => Nil

klass => {function => options}

BEFORE_MAPPINGS = {} of Nil => Nil

klass => {function => options}

CONCRETE_CONTROLLERS = {} of Nil => Nil

Base route => klass name

CRUD_METHODS = {"index" => {"get", "/", false}, "new" => {"get", "/new", false}, "create" => {"post", "/", false}, "show" => {"get", "/:id", true}, "edit" => {"get", "/:id/edit", true}, "update" => {"patch", "/:id", true}, "replace" => {"put", "/:id", true}, "destroy" => {"delete", "/:id", true}}
DEFAULT_PARAM_ID = {} of Nil => Nil

Route IDs params

FILTER_TYPES = ["ROUTES", "BEFORE", "AROUND", "AFTER", "RESCUE", "FORCE", "SKIP"] of ::String
FORCE_MAPPINGS = {} of Nil => Nil

klass => {function => options}

RESCUE_MAPPINGS = {} of Nil => Nil

klass => {function => options}

ROUTES_MAPPINGS = {} of Nil => Nil

klass => {function => options}

SKIP_MAPPINGS = {} of Nil => Nil

klass => {function => options}

TEMPLATE_LAYOUT = {} of Nil => Nil

Template support

TEMPLATE_PATH = {ActionController::Base => "./src/views/"} of Nil => Nil

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from module ActionController::Responders

accepts_formats accepts_formats

Constructor Detail

def self.new(context : HTTP::Server::Context, action_name : Symbol = :index, __head_request__ : Bool = false) #

[View source]

Class Method Detail

def self.__init_routes__(router) #

To support inheritance


[View source]
def self.__route_list__ #

[View source]
def self.__yield__(inst, &) #

[View source]
def self.extract_params(context : HTTP::Server::Context) : URI::Params #

Extracts query and route params into a single URI::Params instance


[View source]

Instance Method Detail

def __cookies__ : HTTP::Cookies | Nil #

[View source]
def __session__ : Session | Nil #

[View source]
def action_name : Symbol #

[View source]
def client_ip : String #

[View source]
def context : HTTP::Server::Context #

[View source]
def cookies : HTTP::Cookies #

[View source]
def files : Hash(String, Array(ActionController::BodyParser::FileUpload)) | Nil #

[View source]
def form_data #

[View source]
def params : URI::Params #

[View source]
def query_params(*args, **options) #

[View source]
def query_params(*args, **options, &) #

[View source]
def render_called : Bool #

[View source]
def request(*args, **options) #

[View source]
def request(*args, **options, &) #

[View source]
def request_content_type : String | Nil #

[View source]
def request_protocol #

=============== Helper methods:


[View source]
def response(*args, **options) #

[View source]
def response(*args, **options, &) #

[View source]
def route_params(*args, **options) #

[View source]
def route_params(*args, **options, &) #

[View source]
def session : Session #

[View source]

Macro Detail

macro __build_filter_inheritance_macros__ #

[View source]
macro __build_filter_mappings__ #

[View source]
macro __create_route_methods__ #

[View source]
macro __draw_routes__ #

[View source]
macro after_action(method, only = nil, except = nil) #

[View source]
macro around_action(method, only = nil, except = nil) #

[View source]
macro base(name = nil) #

[View source]
macro before_action(method, only = nil, except = nil) #

[View source]
macro delete(path, name = nil, annotations = nil, &block) #

[View source]
macro force_ssl(only = nil, except = nil) #

[View source]
macro force_tls(only = nil, except = nil) #

[View source]
macro get(path, name = nil, annotations = nil, &block) #

[View source]
macro id_param(id) #

[View source]
macro layout(filename = nil) #

[View source]
macro options(path, name = nil, annotations = nil, &block) #

[View source]
macro partial(partial, io = nil) #

[View source]
macro patch(path, name = nil, annotations = nil, &block) #

[View source]
macro post(path, name = nil, annotations = nil, &block) #

[View source]
macro put(path, name = nil, annotations = nil, &block) #

[View source]
macro rescue_from(error_class, method = nil, &block) #

[View source]
macro skip_action(method, only = nil, except = nil) #

[View source]
macro template(template = nil, partial = nil, layout = nil, io = nil) #

[View source]
macro template_path(path) #

[View source]
macro ws(path, name = nil, annotations = nil, &block) #

[View source]