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

Partial syntax is fussy #25

Open
MSCAU opened this issue Feb 26, 2019 · 2 comments
Open

Partial syntax is fussy #25

MSCAU opened this issue Feb 26, 2019 · 2 comments

Comments

@MSCAU
Copy link

MSCAU commented Feb 26, 2019

Can you tell me why this works:

render "comments/comment_hide_delete.json.jb"

but this doesn't

render "comments/comment_hide_delete"

and neither does this?

render partial: "comments/comment_hide_delete.json.jb"

@peterxjang
Copy link

I wasn't able to recreate your issue in an example application. Each of these different render statements worked fine in my app:

render "comment"
render "comment.json.jb"
render "comments/comment"
render "comments/comment.json.jb"
render partial: "comment"
render partial: "comment.json.jb"
render partial: "comments/comment"
render partial: "comments/comment.json.jb"

You can see the commit in my example app here: peterxjang/jb_example_app@e9b312f. Is there something more detailed in your example that I'm not accounting for?

As far as I understand, the jb gem isn't responsible for handling the partial syntax. I believe the code that's responsible for parsing that syntax is part of Rails, jb just uses the result. So if there was an issue with inconsistent partial syntax, fixing it would be outside the scope of this gem (someone correct me if I'm wrong here...)

@MSCAU
Copy link
Author

MSCAU commented Mar 27, 2019

Thanks, Peter. I'll need to look into it in a few days as I don't have time now. I think you're right about Rails being the responsible party, though. Good to have you confirm it! I will try to get back to you next week.

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

2 participants