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

Change the way of assigning template variables #4633

Merged
merged 1 commit into from Jan 23, 2017

Commits on Jan 23, 2017

  1. Change the way of assigning template variables

    `ActionView::Base#assign` method removes all previous view variable assignments from ActionView::Base `assigns` hash if there are any.
    
    For example:
    
        template.assigns # => {page_title: "Awesome Title"}
        template.assign(has_many_block: true) # this will clear the `assigns` hash
        template.assigns # => {has_many_block: true}
    
    This commit changes the way of assigning template variables, to avoid previously assigned values loss:
    
        template.assigns[:has_many_block] = true
    Anton Chumakov authored and varyonic committed Jan 23, 2017
    Copy the full SHA
    64f6099 View commit details
    Browse the repository at this point in the history