Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Updates code samples in readme that require colon suffix #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ Eco's syntax is simple:
`property` from the context object passed to `render`.
* `<%= @helper() %>`: Call the helper method `helper` from the context
object passed to `render`, then print its escaped return value.
* `<% @helper -> %>...<% end %>`: Call the helper method `helper` with
* `<% @helper ->: %>...<% end %>`: Call the helper method `helper` with
a function as its first argument. When invoked, the function will
capture and return the content `...` inside the tag.
Note: the colon is required when capturing.
* `<%%` and `%%>` will result in a literal `<%` and `%>` in the
rendered template, respectively.

Expand Down Expand Up @@ -166,7 +167,7 @@ would return:
You can capture blocks of a template by wrapping them in a function
definition. For example, rendering this template:

<% div = (contents) => %>
<% div = (contents) =>: %>
<div><%- contents %></div>
<% end %>
<%= div "Hello" %>
Expand All @@ -181,7 +182,7 @@ argument. Then the `formFor` helper calls this argument to produce a
value.

template = """
<%= @formFor @project, (form) => %>
<%= @formFor @project, (form) =>: %>
<label>Name:</label>
<%= form.textField "name" %>
<% end %>
Expand Down