mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
parent
5459fd31d1
commit
77ccce6105
1 changed files with 10 additions and 3 deletions
13
REFERENCE.md
13
REFERENCE.md
|
@ -107,13 +107,20 @@ output.
|
|||
In Rails, options can be set by setting the {Haml::Template#options Haml::Template.options}
|
||||
hash in an initializer:
|
||||
|
||||
# config/initializers/haml.rb
|
||||
Haml::Template.options[:format] = :html5
|
||||
```ruby
|
||||
# config/initializers/haml.rb
|
||||
Haml::Template.options[:format] = :html5
|
||||
|
||||
# Avoid escaping attributes which are already escaped
|
||||
Haml::Template.options[:escape_attrs] = :once
|
||||
```
|
||||
|
||||
Outside Rails, you can set them by configuring them globally in
|
||||
Haml::Options.defaults:
|
||||
|
||||
Haml::Options.defaults[:format] = :html5
|
||||
```ruby
|
||||
Haml::Options.defaults[:format] = :html5
|
||||
```
|
||||
|
||||
In sinatra specifically, you can set them in global config with:
|
||||
```ruby
|
||||
|
|
Loading…
Reference in a new issue