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 to pass locals when rendering a collection #28

Merged
merged 2 commits into from
Jul 26, 2020

Conversation

marcoroth
Copy link
Member

Type of PR

Feature

Description

This PR implements the suggested solution as described in #27. It allows pass locals when rendering a collection with futurize:

<%= futurize partial: 'items/card', collection: @cards, as: :card, extends: :div, locals: { selected: true } do %>
  <div class="spinner"></div>
<% end %>

Resolves #27.

Why should this be added

In order to stay as close as possible to the render method in Rails it makes sense to support the passing of locals when rendering a collection.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing

Copy link
Contributor

@julianrubisch julianrubisch left a comment

Choose a reason for hiding this comment

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

@marcoroth marcoroth force-pushed the collection-locals branch from 66c6ab0 to eee3619 Compare July 26, 2020 09:29
@marcoroth
Copy link
Member Author

Sure! Just updated the mentioned test :)

@julianrubisch julianrubisch merged commit 50f5c0f into stimulusreflex:master Jul 26, 2020
@julianrubisch
Copy link
Contributor

@all-contributors add @marcoroth for code

@allcontributors
Copy link
Contributor

@julianrubisch

I've put up a pull request to add @marcoroth! 🎉

@marcoroth marcoroth deleted the collection-locals branch July 26, 2020 09:43
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.

Allow to pass locals when rendering a collection
2 participants