0

I've tried prepending content_for with =, == or - without luck :)

index.slim

- content_for(:senarios) do
  h1 Some content

layout.slim

== yield_content(:senarios)

Hope somebody got a solution.

lajlev
  • 772
  • 2
  • 7
  • 22
  • Correct me if I'm wrong, but I don't think this should have a padrino tag if it is for slim, which is a php framework? – kristianp Aug 10 '14 at 23:57

2 Answers2

1

The example should work fine.

You capture content with content_for and insert it in the layout file with yield_content. You can omit the parentheses if you want.

If you use standard Slim settings you need two equal signs. Otherwise the output will be escaped and you will see <h1>Some content</h1> instead of Some content in the rendered output.

I also use this with Middleman and Slim. No issues. Can you please provide more code, errors, etc.?

The only thing which is looking suspicious is the filename index.slim. It should be index.html.slim.

cutemachine
  • 5,520
  • 2
  • 33
  • 30
0

I met same problem, and solved it.

You should change

- content_for(:eyecatch) do

to

= content_for(:eyecatch) do

nested html attributes should no longer be duplicated.

Satoshi Suzuki
  • 116
  • 1
  • 3