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

Passing a block to a partial #429

Open
samstarling opened this issue Mar 16, 2018 · 3 comments
Open

Passing a block to a partial #429

samstarling opened this issue Mar 16, 2018 · 3 comments
Labels

Comments

@samstarling
Copy link

Hello! Is there any way to pass a block to a partial? For example like this

json.partial!('member', member: @member) do
  json.total_loans(@member.total_loans)
end

In the partial, it looks like this:

json.id member.id
json.type member.class
json.attributes do
  json.name member.name
  json.date_of_birth member.date_of_birth
  yield
end

But it doesn't work. Any ideas?

@scriptfans
Copy link

+1 for this

@tien7668
Copy link

tien7668 commented Dec 7, 2018

+1

@scriptfans
Copy link

Is there any news for this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants