Controllers
Controllers map the application to a specified base route. Each controller also contains routes that extend from the base route.
CLI tasks
Example
class ProductController < Eucalypt::Controller(route: '/products')
helpers ProductHelper if defined? ProductHelper
# Route: /products/
get '/' do
@products = Product.all
erb :'products/browse'
end
# Route: /products/:id
get '/:id' do |id|
@product = Product.find id
erb :'products/show'
end
endMain controller
Last updated