New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with content_for and yield_content in sinatra-contrib #1480

Open
programmarchy opened this Issue Sep 28, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@programmarchy

programmarchy commented Sep 28, 2018

Using sinatra 2.0.3 and ruby 2.5.1.

The sinatra-contrib docs say to use <%= yield_content :title do %>Default Title<% end %>, however this produces a SyntaxError originating in tilt's template.rb. Using the <% template operator does not throw a SyntaxError, however, it will only yield the default content i.e. it wont yield the content for :title if it has been set.

Additionally, the sinatra-contrib docs say you can set a value without a block: <% content_for :title, 'My Custom Title' %>, however, this does not work and does not yield the content. However, <% content_for :title do %>My Custom Title<% end %> does correctly yield the content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment