Sha256: 6cd13da30ce932913eb2d5390ba62207e80af6ed24bf1aa14e58a5310b747bfb

Contents?: true

Size: 811 Bytes

Versions: 41

Compression:

Stored size: 811 Bytes

Contents

# Opulent Usage

Opulent can be used to render a file by providing a symbol with the name of the file or to render code by providing a string input.

```ruby
require 'opulent'

Opulent.new.render_file :index
```

Opulent comes with a built in layout system. So if you're not using any web development framework, you'll really appreciate that.
For layouts you can simply use the following code. By default, the layout is set to __layouts/application__.

```ruby
require 'opulent'

opulent = Opulent.new layouts: true
opulent.render_file :index, layout: :'path/to/layout'
```

Here is a list of options you can use with opulent at the moment together with their default values.

```ruby
options = {
  indent: 2,
  layouts: false,
  default_layout: :'views/layouts/application'
}
opulent = Opulent.new options
```

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
opulent-1.8.5 docs/usage.md
opulent-1.8.4 docs/usage.md
opulent-1.8.3 docs/usage.md
opulent-1.8.2 docs/usage.md
opulent-1.8.1 docs/usage.md
opulent-1.8.0 docs/usage.md
opulent-1.7.11 docs/usage.md
opulent-1.7.10 docs/usage.md
opulent-1.7.9 docs/usage.md
opulent-1.7.8 docs/usage.md
opulent-1.7.7 docs/usage.md
opulent-1.7.6 docs/usage.md
opulent-1.7.5 docs/usage.md
opulent-1.7.4 docs/usage.md
opulent-1.7.3 docs/usage.md
opulent-1.7.2 docs/usage.md
opulent-1.7.1 docs/usage.md
opulent-1.7.0 docs/usage.md
opulent-1.6.9 docs/usage.md
opulent-1.6.8 docs/usage.md