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

Add :flush option to content_for. #1518

Merged
merged 1 commit into from Dec 12, 2013
Merged

Add :flush option to content_for. #1518

merged 1 commit into from Dec 12, 2013

Conversation

namusyaka
Copy link
Contributor

content_blocks[key.to_sym] = [(block_given? ? block : Proc.new { content })]
else
content_blocks[key.to_sym] << (block_given? ? block : Proc.new { content })
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, do not duplicate conditions. It's better with content_blocks[key.to_sym].clear if options[:flush]

@namusyaka
Copy link
Contributor Author

Done.

ujifgc added a commit that referenced this pull request Dec 12, 2013
@ujifgc ujifgc merged commit 3fda02d into master Dec 12, 2013
@ujifgc ujifgc deleted the add-flush-to-content_for branch December 12, 2013 09:28
@ujifgc
Copy link
Member

ujifgc commented Dec 12, 2013

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants