Skip to content
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

Allow setting content_for directly #1073

Merged
merged 9 commits into from Jan 22, 2017
Merged

Allow setting content_for directly #1073

merged 9 commits into from Jan 22, 2017

Conversation

denisdefreyne
Copy link
Member

@denisdefreyne denisdefreyne commented Jan 19, 2017

Implements #1066.

In addition to what is currently possible,

content_for(:head) { _erbout << 'stuff' }

it is now possible to pass a string, rather than a block that changes _erbout, to #content_for:

content_for(:head, 'stuff')

Note that

content_for(:head) { 'stuff' }

will (still) not have any effect.

  • Add tests
  • Allow passing string as first arg
  • Refactor

Documentation will be updated afterwards.

@denisdefreyne
Copy link
Member Author

Refactoring idea: passing in @config is ugly. Perhaps having @_context always available could be useful (and the rendering helper would then always pass @_context through).

@sunshineco
Copy link
Contributor

Erm, did you mean s/directory/directly/ in the title of this pull request?

@denisdefreyne
Copy link
Member Author

@sunshineco Ergh, brain fart. Fixed!

@denisdefreyne denisdefreyne changed the title Allow setting content_for directory Allow setting content_for directly Jan 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants