Skip to content

Instantly share code, notes, and snippets.

@ASnow
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ASnow/429891cd0e24c4314df8 to your computer and use it in GitHub Desktop.
Save ASnow/429891cd0e24c4314df8 to your computer and use it in GitHub Desktop.
Slim templating in Volt
# SEE https://github.com/ASnow/guard-volt-slim
tpl-title
| Test
tpl-body
.index
.form
.form_lable Lable
input.form_var value="#{ _var }"
- if condition?
input.form_btn type="submit" value="Go" e-click="send_code"
.last-submit-result
| {{_state}}
.debug
| User {{Volt.current_user }}
tpl-title
= view main_path, "title", {controller_group: 'main'}
tpl-body
.container
.header
ul.nav.nav-pills.pull-right
use-nav href="/" Home
use-nav href="/about" About
use-user_templates:menu
h3.text-muted .
use-volt:notices
= view main_path, 'body', {controller_group: 'main'}
.footer
p © Company #{ Time.now.year }
tpl-nav
li class="#{attrs.href}"
a href="#{attrs.href}"= yield
@ASnow
Copy link
Author

ASnow commented Jul 6, 2015

"tpl-" is section
"use-" is yield binding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment