-
Notifications
You must be signed in to change notification settings - Fork 201
Expand file tree
/
Copy pathexample-usage.html
More file actions
63 lines (57 loc) · 1.83 KB
/
Copy pathexample-usage.html
File metadata and controls
63 lines (57 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<section class="layout layout--light">
<section class="content content--small">
<h1>Example Usage</h1>
<p>
First, specify in your controller that you don't want to render the layout
(since EmberCLI's index.html is a fully-formed HTML document):
</p>
<div class="code">
<div class="code__header">
app/controllers/application.rb
</div>
<pre class="code__body">
<code>
class ApplicationController < ActionController::Base
def index
render layout: false
end
end</code>
</pre>
</div>
<p>
To render the EmberCLI generated index.html into the view, use the
include_ember_index_html helper:
</p>
<div class="code ERB">
<div class="code__header">
app/views/application/index.html.erb
</div>
<pre class="code__body">
<code class="ERB">
<span class="tag"><%=</span> include_ember_index_html :frontend <span class="tag">%></span></code>
</pre>
</div>
<p>
To inject markup into page, pass in a block that accepts the head, and
(optionally) the body:
</p>
<div class="code ERB">
<div class="code__header">
app/views/application/index.html.erb
</div>
<pre class="code__body">
<code>
<span class="tag"><%=</span> include_ember_index_html :frontend do |head| <span class="tag">%></span>
<span class="tag"><%</span> head.append do <span class="tag">%></span>
<span class="tag"><%=</span> csrf_meta_tags <span class="tag">%></span>
<span class="tag"><%</span> end <span class="tag">%></span>
<span class="tag"><%</span> end <span class="tag">%></span></code>
</pre>
</div>
<footer class="content__footer">
<a class="button" href="https://github.com/thoughtbot/ember-cli-rails">
Full Documentation
</a>
</footer>
</section>
</section>