Sha256: 0ca340bf8525572116e1a9fb8abd4656a39d834478871e74bd0ada2cbd411ba7

Contents?: true

Size: 1019 Bytes

Versions: 8

Compression:

Stored size: 1019 Bytes

Contents

# Renee Render

Rendering templates in Renee should be familiar and intuitive using the `render` command:

```ruby
run Renee.core {
 path('blog') do
   get { render! "blogs/index", :haml }
 end
}
```

This above is the standard render syntax, specifying the engine followed by the template. You can also render without specifying an engine:

```ruby
path('blog') do
  get { render! "blogs/index" }
end
```

This will do a lookup in the views path to find the appropriately named template. You can also pass locals and layout options as you would expect:

```ruby
path('blog') do
  get { render! "blogs/index", :locals => { :foo => "bar" }, :layout => :bar }
end
```

This will render the "blogs/index.erb" file if it exists, passing the 'foo' local variable
and wrapping the result in the 'bar.erb' layout file. You can also render without returning the response by using:

```ruby
path('blog') do
  get { render "blogs/index" }
end
```

This allows you to render the content as a string without immediately responding.

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
renee-0.4.0.pre1 README-renee-render.md
renee-render-0.3.11 README.md
renee-render-0.3.10 README.md
renee-render-0.3.7 README.md
renee-render-0.3.6 README.md
renee-render-0.3.2 README.md
renee-render-0.3.1 README.md
renee-render-0.3.0 README.md