Skip to content

Partial code executed twice #103

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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