stonean/slim — Issue #209: sinatra content_for w/ slim
Author: tkellen
Created: 2011-11-27 05:42:51+00:00
State: open

Hey guys... I just posted this over @ sinatra-contrib, but I figured I'd post it here too, since I'm not sure where the problem actually is.

Is this a Slim problem?

**Test Case**

app.rb:

```ruby
require 'slim'
require 'haml'
require 'sinatra/base'
require 'sinatra/content_for'

class Main < Sinatra::Base

helpers Sinatra::ContentFor

get '/' do
slim :test
end

end
```

views/layout.slim:

```ruby
html
head
meta charset='utf8'
title test
body
== yield
== yield_content :test
```

views/test.slim

```ruby
- content_for :test do
test content

h1 page title

h2 page subtitle
```

... the block return isn't working correctly, it sends the entire template. Using = content_for works, but since that returns a proc, it prints #[