Sha256: 2d761f439e4747c0372865c4716a9277d77200b1fb7302765c646683951ed805

Contents?: true

Size: 621 Bytes

Versions: 3

Compression:

Stored size: 621 Bytes

Contents

# Slim

Slim is a HTML templating langage, simple to implement in the Nephos Server.
[Slim documentation](http://slim-lang.com)

## Installation
```bash
gem install slim
```

## Usage in Nephos Server
You can add the following code in ``/slim.rb``:

```ruby
def slim(file, locals)
  Slim::Template.new() { File.read('app/views/' + file) }.render(nil, locals)
end
```

### Example
```ruby
require 'slim'

class UserController < Nephos::Controller

  # /user/:id
  def show
    user = User.find(params[:id])
    Slim::Template.new() { File.read('app/views/user/show.slim') }.render(nil, {login: user.login})
  end

end
```

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nephos-server-0.7.2 DOCUMENTATION/TEMPLATING/SLIM.md
nephos-server-0.7.1 DOCUMENTATION/TEMPLATING/SLIM.md
nephos-server-0.7.0 DOCUMENTATION/TEMPLATING/SLIM.md