Move "Embedded Templates" subsection in README

Move "Embedded Templates" subsection in English and Russian README to a more appropriate place.
This commit is contained in:
Alexey Muranov 2013-02-25 14:21:01 +01:00
parent d03ca728b5
commit e7d208310d
2 changed files with 20 additions and 20 deletions

View File

@ -401,6 +401,16 @@ Available Options:
</dd>
</dl>
#### Embedded Templates
```ruby
get '/' do
haml '%div.title Hello World'
end
```
Renders the embedded template string.
### Available Template Languages
Some languages have multiple implementations. To specify what implementation
@ -864,16 +874,6 @@ The `:callback` and `:variable` options can be used to decorate the rendered obj
Since calling ruby methods is not idiomatic in wlang, you almost always want to pass locals
to it. Layouts written in wlang and `yield` are supported, though.
#### Embedded Templates
```ruby
get '/' do
haml '%div.title Hello World'
end
```
Renders the embedded template string.
### Accessing Variables in Templates
Templates are evaluated within the same context as route handlers. Instance

View File

@ -416,6 +416,16 @@ set :views, settings.root + '/templates'
`:'subdir/template'`). Вы должны использовать символы, потому что иначе
шаблонизаторы попросту отображают любые строки, переданные им.
#### Встроенные шаблоны
```ruby
get '/' do
haml '%div.title Hello World'
end
```
Отобразит встроенный шаблон, переданный строкой.
### Доступные шаблонизаторы
Некоторые языки шаблонов имеют несколько реализаций. Чтобы указать, какую
@ -886,16 +896,6 @@ var resource = {"foo":"bar","baz":"qux"}; present(resource);
исключением `yield`), то вы почти всегда будете передавать в шаблон локальные
переменные.
### Встроенные шаблоны
```ruby
get '/' do
haml '%div.title Hello World'
end
```
Отобразит встроенный шаблон, переданный строкой.
### Доступ к переменным в шаблонах
Шаблоны интерпретируются в том же контексте, что и обработчики маршрутов.