rtomayko / tilt

Generic interface to multiple Ruby template engines

Home Page:http://github.com/rtomayko/tilt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxError when rendering ERB `<%=` with a block

programmarchy opened this issue · comments

Potentially related to sinatra/sinatra#1480

Rendering <%= yield_content :title do %>Default Title<% end %> throws a SyntaxError in tilt's template.rb.

ERB (that ships with Ruby) doesn't support block helpers by default. I'm guessing Sinatra uses a different template engine and it's somehow not being registered. It's a bit difficult for me to help without knowing the approach that Sinatra uses.

@judofyr thanks for your response. Sinatra uses ERB unless the erubis gem is loaded. I don't think either support block helpers as you mentioned. Do you know of any options to provide support for this syntax?

Sorry nevermind, I discovered Sinatra makes the ERB output var available to be modified.