Skip to content

Instantly share code, notes, and snippets.

@pedrozath
Created September 26, 2015 00:32
Show Gist options
  • Select an option

  • Save pedrozath/be25e1cf91fd2b07f2bc to your computer and use it in GitHub Desktop.

Select an option

Save pedrozath/be25e1cf91fd2b07f2bc to your computer and use it in GitHub Desktop.
erb:
<p>You can also embed html in the text line</p>
<pre class="code slim"><code class="slim">- articles.each do |a|
| &lt;tr&gt;&lt;td&gt;#{a.name}&lt;/td&gt;&lt;td&gt;#{a.description}&lt;/td&gt;&lt;/tr&gt;
</code></pre>
<h3>Verbatim text with trailing white space <code>'</code></h3>
<p>The single quote tells Slim to copy the line (similar to <code>|</code>), but makes sure that a single trailing white space is appended.</p>
<h3>Inline html <code>&lt;</code></h3>
<p>You can write html tags directly in Slim which allows you to write your templates in a more html like style with closing tags or mix html and Slim style.
The leading <code>&lt;</code> works like an implicit <code>|</code>:</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment