Skip to content

Partial code executed twice #103

@gryphon

Description

@gryphon

Accidentally found that with nice partials all code within partial block executed twice.
Looks like this is needed to identify yield blocks prior to rendering.

You can check it by having form with nested has_many association fields embedded as block.
When rendered first time, nested inputs will have [0] index.
When rendered second time, inputs will have non-zero index.

If you have more partials nested to each other, it looks like nice partials will execute all code 2^N times, where N is level of partials nesting.

This probably may affect performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions