Respond With

If we need to render a template to html render("template.slang") works nicely. A lot of times we want to respond with json, xml, text or something else. In those cases we use respond_with.

respond_with Demo

See video on Youtube

Examples Usages

Responding with JSON

Responding with XML

Responding with Text

Responding to All

Put it all together and you can respond to whatever is asked for.

Last updated