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

Conversation

Projects
None yet
2 participants
@ddfreyne
Copy link
Member

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 added some commits Jan 19, 2017

@ddfreyne

This comment has been minimized.

Copy link
Member Author

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

@sunshineco

This comment has been minimized.

Copy link
Contributor

sunshineco commented Jan 19, 2017

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

@ddfreyne

This comment has been minimized.

Copy link
Member Author

ddfreyne commented Jan 19, 2017

@sunshineco Ergh, brain fart. Fixed!

@ddfreyne ddfreyne changed the title Allow setting content_for directory Allow setting content_for directly Jan 19, 2017

ddfreyne added some commits Jan 19, 2017

ddfreyne added some commits Jan 21, 2017

@ddfreyne ddfreyne added this to the 4.5.5 milestone Jan 22, 2017

@ddfreyne ddfreyne modified the milestones: 4.6, 4.5.5 Jan 22, 2017

@ddfreyne ddfreyne merged commit e1dbb5c into master Jan 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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
You can’t perform that action at this time.