class TasksController
- TasksController
- Application
- ActionController::Base
- Reference
- Object
Overview
class TasksController < ActionController::Base
Defined in:
controllers/tasks.crConstant Summary
-
AFTER =
{} of Nil => Nil
-
class TasksController < ActionController::Base
-
AROUND =
{} of Nil => Nil
-
class TasksController < ActionController::Base
-
BEFORE =
{find_task => {[show, update, destroy], nil}, set_request_id => {nil, nil}, set_date_header => {nil, nil}} of Nil => Nil
-
class TasksController < ActionController::Base
-
FORCE =
{} of Nil => Nil
-
class TasksController < ActionController::Base
-
LOCAL_AFTER =
{} of Nil => Nil
-
function => options
-
LOCAL_AROUND =
{} of Nil => Nil
-
function => options
-
LOCAL_BEFORE =
{find_task => {[show, update, destroy], nil}} of Nil => Nil
-
function => options
-
LOCAL_FORCE =
{} of Nil => Nil
-
function => options
-
LOCAL_RESCUE =
{JSON::SerializableError => {json_serializable_error, do |error| render(text: error.message, status: 500) end}, NotImplementedError => {not_implemented_error, do |exception| render(text: exception.message, status: 501) end}} of Nil => Nil
-
function => options
-
LOCAL_ROUTES =
{options_ => {"options", "/", do response.headers["Access-Control-Allow-Origin"] = "*" response.headers["Access-Control-Allow-Methods"] = "GET, POST, PATCH, DELETE, HEAD, OPTIONS" response.headers["Access-Control-Allow-Headers"] = "Content-Type" end, false}, options__id => {"options", "/:id", do response.headers["Access-Control-Allow-Origin"] = "*" response.headers["Access-Control-Allow-Methods"] = "GET, POST, PATCH, DELETE, HEAD, OPTIONS" response.headers["Access-Control-Allow-Headers"] = "Content-Type" end, false}} of Nil => Nil
-
function => options
-
LOCAL_SKIP =
{} of Nil => Nil
-
function => options
-
Log =
::Log.for("controller")
-
NAMESPACE =
["/tasks"]
-
default namespace based on class
-
RESCUE =
{JSON::SerializableError => {json_serializable_error, do |error| render(text: error.message, status: 500) end}, NotImplementedError => {not_implemented_error, do |exception| render(text: exception.message, status: 501) end}} of Nil => Nil
-
class TasksController < ActionController::Base
-
ROUTES =
{options_ => {"options", "/", do response.headers["Access-Control-Allow-Origin"] = "*" response.headers["Access-Control-Allow-Methods"] = "GET, POST, PATCH, DELETE, HEAD, OPTIONS" response.headers["Access-Control-Allow-Headers"] = "Content-Type" end, false}, options__id => {"options", "/:id", do response.headers["Access-Control-Allow-Origin"] = "*" response.headers["Access-Control-Allow-Methods"] = "GET, POST, PATCH, DELETE, HEAD, OPTIONS" response.headers["Access-Control-Allow-Headers"] = "Content-Type" end, false}, index => {"get", "/", nil, false}, show => {"get", "/:id", nil, false}, create => {"post", "/", nil, false}, update => {"patch", "/:id", nil, false}, destroy => {"delete", "/:id", nil, false}} of Nil => Nil
-
class TasksController < ActionController::Base
-
SKIP =
{} of Nil => Nil
-
class TasksController < ActionController::Base
Class Method Summary
-
.__init_routes__(router)
Routes call the functions generated above
-
.__route_list__
Create draw_routes function
-
.base_route
Helper for obtaining base route
-
.context(method : String, route : String, route_params : Hash(String, String) | Nil = nil, headers : Hash(String, String) | Nil = nil, body : String | Bytes | IO | Nil = nil, &)
class TasksController < ActionController::Base
-
.create(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
-
.delete__tasks__id(context, head_request)
Create draw_routes function
-
.destroy(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
-
.get__tasks_(context, head_request)
Create draw_routes function
-
.get__tasks__id(context, head_request)
Create draw_routes function
-
.index(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
-
.options_(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Helper methods for performing redirect_to calls
-
.options__id(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
-
.options__tasks_(context, head_request)
Generate functions for each route
-
.options__tasks__id(context, head_request)
Create draw_routes function
-
.patch__tasks__id(context, head_request)
Create draw_routes function
-
.post__tasks_(context, head_request)
Create draw_routes function
-
.show(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
-
.update(hash_parts : Hash(String | Symbol, Nil | Bool | Int32 | Int64 | Float32 | Float64 | String | Symbol) | Nil = nil, **tuple_parts)
Create draw_routes function
Instance Method Summary
-
#base_route : String
Helper for obtaining base route
-
#create
POST /tasks/
-
#destroy
DELETE /tasks/:id
-
#index
CRUD methods GET /tasks/
-
#json_serializable_error(error)
Create functions as required for errors Skip the CRUD
-
#not_implemented_error(exception)
Skip the CRUD
-
#options_
Create functions for named routes Skip the CRUD
-
#options__id
Skip the CRUD
-
#show
GET /tasks/:id
-
#task : Task
Lazy initialization via getter macro - https://crystal-lang.org/api/0.36.1/Object.html#getter(*names,&block)-macro
-
#update
PATCH /tasks/:id
Macro Summary
-
__inherit_after_filters__
class TasksController < ActionController::Base
-
__inherit_around_filters__
class TasksController < ActionController::Base
-
__inherit_before_filters__
class TasksController < ActionController::Base
-
__inherit_force_filters__
class TasksController < ActionController::Base
-
__inherit_rescue_filters__
class TasksController < ActionController::Base
-
__inherit_routes_filters__
class TasksController < ActionController::Base
-
__inherit_skip_filters__
class TasksController < ActionController::Base
Instance methods inherited from class Application
set_date_header
set_date_header,
set_request_id
set_request_id
Class methods inherited from class Application
context(method : String, route : String, route_params : Hash(String, String) | Nil = nil, headers : Hash(String, String) | Nil = nil, body : String | Bytes | IO | Nil = nil, &)
context
Class Method Detail
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
class TasksController < ActionController::Base
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Helper methods for performing redirect_to calls
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Create draw_routes function
Create instance of controller class init with context, params and logger protocol checks (https etc) controller instance created begin exception helpers inline the around filters inline the before filters inline the action inline the after filters rescue exception handlers
Instance Method Detail
Lazy initialization via getter macro - https://crystal-lang.org/api/0.36.1/Object.html#getter(*names,&block)-macro