added documentation for replacing #find_template
This commit is contained in:
parent
f7dfcb35a5
commit
a5c4367a4c
17
README.md
17
README.md
|
@ -1231,6 +1231,23 @@ end
|
|||
Renders `./views/index.myat`. See https://github.com/rtomayko/tilt to
|
||||
learn more about Tilt.
|
||||
|
||||
### Using Custom Logic for Template Lookup
|
||||
|
||||
To implement your own template lookup mechanism you can write your
|
||||
own `#find_template` method:
|
||||
|
||||
``` ruby
|
||||
configure do
|
||||
set :views [ './views/a', './views/b' ]
|
||||
end
|
||||
|
||||
def find_template(views, name, engine, &block)
|
||||
Array(views).each do |v|
|
||||
super(v, name, engine, &block)
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
## Filters
|
||||
|
||||
Before filters are evaluated before each request within the same
|
||||
|
|
Loading…
Reference in New Issue