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

@ddfreyne
Copy link
Member

@ddfreyne ddfreyne 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.

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Jan 19, 2017

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).

Loading

@sunshineco
Copy link
Contributor

@sunshineco sunshineco commented Jan 19, 2017

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

Loading

@ddfreyne
Copy link
Member Author

@ddfreyne ddfreyne commented Jan 19, 2017

@sunshineco Ergh, brain fart. Fixed!

Loading

@ddfreyne ddfreyne changed the title Allow setting content_for directory Allow setting content_for directly Jan 19, 2017
@ddfreyne ddfreyne added this to the 4.5.5 milestone Jan 22, 2017
@ddfreyne ddfreyne added this to the 4.6 milestone Jan 22, 2017
@ddfreyne ddfreyne removed this from the 4.5.5 milestone Jan 22, 2017
@ddfreyne ddfreyne merged commit e1dbb5c into master Jan 22, 2017
1 check passed
Loading
@ddfreyne ddfreyne deleted the refactor-capturing branch Jan 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants