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

Add json.partial!(@record) #265

Closed
dhh opened this issue May 13, 2015 · 7 comments
Closed

Add json.partial!(@record) #265

dhh opened this issue May 13, 2015 · 7 comments

Comments

@dhh
Copy link
Member

dhh commented May 13, 2015

Currently you have to write:

ruby json.partial! 'messages/message', message: @message

Even when all that is guessable from the @message object. Instead, we should do like Action Pack:

ruby json.partial! @message

When we check if the passed object responds to #to_partial_path and then uses that to construct.

@rwz
Copy link
Collaborator

rwz commented May 13, 2015

Shouldn't be that hard. I can do this over the weekend or you take a shot if you need it sooner :)

@dhh
Copy link
Member Author

dhh commented May 13, 2015

Would love that. Gracias!

On Wed, May 13, 2015 at 6:08 PM, Pavel Pravosud notifications@github.com
wrote:

Shouldn't be that hard. I can do this over the weekend or you take a shot
if you need it sooner :)


Reply to this email directly or view it on GitHub
#265 (comment).

rwz added a commit that referenced this issue May 19, 2015
@rwz
Copy link
Collaborator

rwz commented May 19, 2015

This is done in the https://github.com/rails/jbuilder/tree/ar-partial-api branch.

It'd be great if you give it a try before we proceed with documentation and merging. :)

@dhh
Copy link
Member Author

dhh commented May 20, 2015

We'll give it a try! @zachwaugh from Basecamp is working on a bunch of
jbuilder templates right now, so he'll be in touch shortly. Thanks again
for your help with this!

On Tue, May 19, 2015 at 9:53 AM, Pavel Pravosud notifications@github.com
wrote:

This is done in the https://github.com/rails/jbuilder/tree/ar-partial-api
branch.

It'd be great if you give it a try before we proceed with documentation
and merging. :)


Reply to this email directly or view it on GitHub
#265 (comment).

@rwz
Copy link
Collaborator

rwz commented May 30, 2015

Hey @zachwaugh, do you have any feedback? Does everything work for you?

@zachwaugh
Copy link

@rwz Tested it out, and everything looks good here 👍 , thanks!

@rwz rwz closed this as completed in 4d5bf7d Jun 15, 2015
@chrisnicola
Copy link

@rwz curious if this should also consider json.array!. e.g.)

json.array! @messages

As far as I can tell that doesn't work implicitly at the moment.

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

No branches or pull requests

4 participants