module LavinMQ::HTTP::ViewHelpers
Direct including types
Defined in:
lavinmq/http/controller/view_helpers.crMacro Summary
- active_path?(path)
-
escape(value)
Use in view to html escape output
<% escape varaible_name %>or<% escape "string" %> -
render(file)
Render an ecr file from views dir
-
static_view(path, view = nil, &block)
Generate a get handler for given path.
Macro Detail
macro escape(value)
#
Use in view to html escape output
<% escape varaible_name %> or <% escape "string" %>
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