action-controller
Version, currently 8.0.0100 versions
- 8.0.0latestJun 30, 2026
- 7.6.1not indexedJun 30, 2026
- 7.6.0not indexedJun 30, 2026
- 7.5.3not indexedJun 30, 2026
- 7.5.2not indexedJun 30, 2026
- 7.5.1not indexedJun 30, 2026
- 7.5.0not indexedJun 30, 2026
- 7.4.4not indexedJun 30, 2026
- 7.4.3not indexedJun 30, 2026
- 7.4.2not indexedJun 30, 2026
- 7.4.1not indexedJun 30, 2026
- 7.4.0not indexedJun 30, 2026
- 7.3.1not indexedJun 30, 2026
- 7.3.0not indexedJun 30, 2026
- 7.2.3not indexedJun 30, 2026
- 7.2.2not indexedJun 30, 2026
- 7.2.1not indexedJun 30, 2026
- 7.2.0not indexedJun 30, 2026
- 7.1.1not indexedJun 30, 2026
- 7.1.0not indexedJun 30, 2026
- 7.0.4not indexedJun 30, 2026
- 7.0.3not indexedJun 30, 2026
- 7.0.2not indexedJun 30, 2026
- 7.0.1not indexedJun 30, 2026
- 7.0.0not indexedJun 30, 2026
- 6.1.2not indexedJun 30, 2026
- 6.1.1not indexedJun 30, 2026
- 6.1.0not indexedJun 30, 2026
- 6.0.1not indexedJun 30, 2026
- 6.0.0not indexedJun 30, 2026
- 5.6.4not indexedJun 30, 2026
- 5.6.3not indexedJun 30, 2026
- 5.6.2not indexedJun 30, 2026
- 5.6.1not indexedJun 30, 2026
- 5.6.0not indexedJun 30, 2026
- 5.5.4not indexedJun 30, 2026
- 5.5.3not indexedJun 30, 2026
- 5.5.2not indexedJun 30, 2026
- 5.5.1not indexedJun 30, 2026
- 5.5.0not indexedJun 30, 2026
- 5.4.3not indexedJun 30, 2026
- 5.4.2not indexedJun 30, 2026
- 5.4.1not indexedJun 30, 2026
- 5.4.0not indexedJun 30, 2026
- 5.3.14not indexedJun 30, 2026
- 5.3.13not indexedJun 30, 2026
- 5.3.12not indexedJun 30, 2026
- 5.3.11not indexedJun 30, 2026
- 5.3.10not indexedJun 30, 2026
- 5.3.9not indexedJun 30, 2026
- 5.3.8not indexedJun 30, 2026
- 5.3.7not indexedJun 30, 2026
- 5.3.6not indexedJun 30, 2026
- 5.3.5not indexedJun 30, 2026
- 5.3.4not indexedJun 30, 2026
- 5.3.3not indexedJun 30, 2026
- 5.3.2not indexedJun 30, 2026
- 5.3.1not indexedJun 30, 2026
- 5.3.0not indexedJun 30, 2026
- 5.2.0not indexedJun 30, 2026
- 5.1.9not indexedJun 30, 2026
- 5.1.8not indexedJun 30, 2026
- 5.1.7not indexedJun 30, 2026
- 5.1.6not indexedJun 30, 2026
- 5.1.5not indexedJun 30, 2026
- 5.1.4not indexedJun 30, 2026
- 5.1.3not indexedJun 30, 2026
- 5.1.2not indexedJun 30, 2026
- 5.1.1not indexedJun 30, 2026
- 4.10.1not indexedJun 30, 2026
- 4.10.0not indexedJun 30, 2026
- 4.9.0not indexedJun 30, 2026
- 4.8.0not indexedJun 30, 2026
- 4.7.3not indexedJun 30, 2026
- 4.7.2not indexedJun 30, 2026
- 4.7.1not indexedJun 30, 2026
- 4.7.0not indexedJun 30, 2026
- 4.6.0not indexedJun 30, 2026
- 4.5.2not indexedJun 30, 2026
- 4.5.1not indexedJun 30, 2026
- 4.5.0not indexedJun 30, 2026
- 4.4.1not indexedJun 30, 2026
- 4.4.0not indexedJun 30, 2026
- 4.3.6not indexedJun 30, 2026
- 4.3.5not indexedJun 30, 2026
- 4.3.4not indexedJun 30, 2026
- 4.3.3not indexedJun 30, 2026
- 4.3.2not indexedJun 30, 2026
- 4.3.1not indexedJun 30, 2026
- 4.3.0not indexedJun 30, 2026
- 4.2.2not indexedJun 30, 2026
- 4.2.1not indexedJun 30, 2026
- 4.2.0not indexedJun 30, 2026
- 4.1.0not indexedJun 30, 2026
- 4.0.0not indexedJun 30, 2026
- 3.5.2not indexedJun 30, 2026
- 3.5.1not indexedJun 30, 2026
- 3.5.0not indexedJun 30, 2026
- 3.4.2not indexedJun 30, 2026
- 3.4.1not indexedJun 30, 2026
github.com/spider-gazelle/action-controller
A rails-esque controller framework for crystal lang
43 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
action-controller:
github: spider-gazelle/action-controller
version: ~> 8.0.0Then run:
shards installshard.yml
- Crystal
>= 1.9.0- License
- MIT
- Authors
- Stephen von Takach <steve@place.tech>, Caspian Baska <caspian@place.tech>, Kim Burgess <kim@place.tech>, Duke Nguyen <duke@place.tech>
Dependencies
Runtime Dependencies
- habitat>= 0.4github: luckyframework/habitat
- hot_topic*github: jgaskins/hot_topic
- json-schema>= 1.3github: spider-gazelle/json-schema
- lucky_router>= 0.6.1github: luckyframework/lucky_router
- exception_page>= 0.5github: crystal-loot/exception_page
Development Dependencies
- kilt*github: jeromegn/kiltdev
- ameba*github: veelenga/amebadev
README
# Spider-Gazelle Action Controller
[](https://github.com/spider-gazelle/action-controller/actions/workflows/ci.yml)
Extending [lucky_router](https://github.com/luckyframework/lucky_router) for a Rails like DSL without the overhead. See the [docs site](https://spider-gazelle.net/) for usage details
## Strong Parameter Usage
```crystal
require "action-controller"
# Abstract classes don't generate routes
abstract class Application < ActionController::Base
# A filter can raise or render to prevent a route being executed
@[AC::Route::Filter(:before_action)]
def ensure_authenticated
render :unauthorized unless cookies["user"]
end
# You can define controller level exception handlers for consistent error messages
# note, the first param is always the error object
@[AC::Route::Exception(Route::Param::Error, status_code: :not_found)]
def route_param_error(error, id : Int64?)
# as id is nillable, it will look for a supplied id (route, query, formdata)
# and set it if one was found and it could be converted
{
error: error.message,
parameter: error.parameter,
restriction: error.restriction
}
end
end
# Full inheritance support (concrete classes generate routes)
class Books < Application
# this is automatically configured based on class name and namespace
# it can be overriden here
base "/books"
# route => "/books/?book=1234"
@[Route::GET("/")]
def index(book : UInt64? = nil) : Array(String)
redirect_to Books.show(id: book) if book
["book1", "book2"]
end
# Params are automatically extracted and converted to the corrent type
# here `id` in the route matches the `id` paramater in the function
# route => "/books/0FF/hex"
# route => "/books/123"
@[Route::GET("/:id/hex", config: {id: {base: 16}})]
@[Route::GET("/:id")]
def show(id : UInt64)
{id: id, name: "book1"}
end
enum Color
Red
Blue
Green
end
# route => "/books/set_color/RED"
# route => "/books/set_color/colour_value/2"
@[Route::GET("/set_color/:colour")]
@[Route::GET("/set_color/colour_value/:colour", config: {colour: {from_value: true}})]
def set_color(color : Color) : String
colour.to_s
end
# Websocket support, the first param is always the socket object
# route => "/books/:id/realtime"
@[AC::Route::WebSocket("/:id/realtime")]
def realtime(socket, id : UInt64)
SOCKETS << socket
socket.on_message do |message|
SOCKETS.each { |socket| socket.send "Echo back from server: #{message}" }
end
socket.on_close do
SOCKETS.delete(socket)
end
end
SOCKETS = [] of HTTP::WebSocket
end
```
* For more details on usage, see [the documentation](https://spider-gazelle.net/).
* Also see [detailed project documentation](https://spider-gazelle.github.io/action-controller/ActionController.html)
* Running heavy endpoints on dedicated scheduler pools: [Execution Contexts](CONTEXTS.md)
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
8.0.0- Tagged
- Jun 30, 2026
- Commit
298c18cfa504- Crystal
>= 1.9.0- Indexed
- yes
Dependents
Repository
github.com/spider-gazelle/action-controller
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 12, 2026
- Synced
- Aug 12, 2026
- Versions
- 100