class LavinMQ::HTTP::ViewsController

Included Modules

Defined in:

lavinmq/http/controller/views.cr

Constant Summary

ETag = "W/\"1707185402\""

Constructors

Macro Summary

Constructor Detail

def self.new #

[View source]

Macro Detail

macro active_path?(path) #

[View source]
macro render(file) #

Render an ecr file from views dir


[View source]
macro static_view(path, view = nil, &block) #

Generate a get handler for given path. If no view is specified, path without initial slash will be used as view.

Optional block can be given to modify context or set variables before view is rendered.

This would render views/json_data.ecr and change content type:

static_view "/json", "json_data" do
  context.response.content_type = "application/json"
end

[View source]