Rocket::Controller
Inherits Reference < Object
A controller defines actions. When called these actions execute the logic and return text to render through the response. A controller has a Hash of params which give access to all the params defined in the route and the query params.
Constructors
new
The macro stores actions as a Proc in a Hash
so that actions['action_name'].call executes the action.
Instance methods
action_exists?(action_name)
Returns true if the action with action_name has been defined in the controller, false otherwise.
actions
Sourceactions=(actions : Hash(String, -> String))
Sourcecontext
Sourcecontext=(context : HTTP::Server::Context)
Sourceparams
Sourceparams=(params : Hash(String, Nil | String))
Source