0

Server Log:

Processing by GamesController#index as HTML
  Rendered games/index.haml within layouts/games (0.1ms)
Completed 500 Internal Server Error in 6ms (ActiveRecord: 0.0ms)

Truncated layout is:

  %body
    = render partial: '/layouts/gamescreen/viewport'
      = yield

Partial games.haml content is a single Haml div:

  #viewport

Yield'ed view is:

  Hi!

Resulted error message:

  /home/ubuntu/workspace/app/views/layouts/games.haml:12: syntax error, unexpected keyword_ensure, expecting end-of-input
Vitalyp
  • 1,069
  • 1
  • 11
  • 20

1 Answers1

1

I believe the answer for this question "Rails render partial with block" holds the solution.

In your layout you'd use

= render layout: '/layouts/gamescreen/viewport' do 
  Hi!

And in your layouts/gamescreen/viewport partial, you'd have

= yield
Community
  • 1
  • 1
Patrik Affentranger
  • 13,245
  • 2
  • 22
  • 25