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

Contextual placeholder arguments #108

Merged
merged 4 commits into from
Sep 9, 2021

Conversation

julianrubisch
Copy link
Contributor

Feature

Description

Passes a record and index arguments to any futurize placeholder block rendered either for an ActiveRecord::Base or any type of collection.

I.e. you can do

<%= futurize Post.all .... do |post, index| %>
  <li><%= index + 1 %>. <%= post.title %></li>
<% end %>

Fixes #104

Checklist

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

@julianrubisch julianrubisch marked this pull request as ready for review August 29, 2021 17:57
@julianrubisch julianrubisch requested a review from hopsoft August 29, 2021 17:57
@julianrubisch
Copy link
Contributor Author

@hopsoft could you take a cursory look at this PR and look if it does what you expect?

@julianrubisch julianrubisch merged commit c00a229 into master Sep 9, 2021
@julianrubisch julianrubisch deleted the contextual-placeholder-arguments branch September 9, 2021 10:53
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.

Pass contextual arguments to the futurize yield block
1 participant