Sha256: 227d949449f51099d6b234411ef7598dfea974d799d27222267654b0b2ff040f
Contents?: true
Size: 816 Bytes
Versions: 41
Compression:
Stored size: 816 Bytes
Contents
# Opulent Expressions Opulent makes it possible to write inline Ruby code in your templates. There are a few types of code. ##Unbuffered Code Unbuffered code starts with `-` (single line) or `+` (multi line) and does not provide an output directly. ```sass - a = 1 + 2 + 3 + if a == 6 a = 3 end ``` ## Buffered Code Buffered code starts with `=` and it outputs the Ruby expression as plain text. For safety reasons, it will be escaped by default. ```sass p = "this is " + "an <escaped> ruby expression" ``` ```html <p> this is an <escaped> ruby expression </p> ``` ## Unuffered Code Whenever we want to unescape an output in Opulent, we use the tilde character `~` to do so. ```sass p =~ "this is " + "an <escaped> ruby expression" ``` ```html <p>this is an <escaped> ruby expression</p> ```
Version data entries
41 entries across 41 versions & 1 rubygems