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

Support Strict Locals #557

Closed
wants to merge 1 commit into from

Conversation

seanpdoyle
Copy link

When scaffolding out partials, generate template files with a Strict Locals magic comment based on the name of the resource (for example, # locals: (post:) when generating _post.json.jbuilder).

When scaffolding out partials, generate template files with a [Strict
Locals][] magic comment based on the name of the resource (for example,
`# locals: (post:)` when generating `_post.json.jbuilder`).

[Strict Locals]: https://guides.rubyonrails.org/action_view_overview.html#strict-locals
@seanpdoyle
Copy link
Author

This is facing issues similar to rails/rails#49761 (which was resolved by rails/rails#49782).

@casperisfine
Copy link

Do you need help to fix this, or are you on it?

@seanpdoyle
Copy link
Author

seanpdoyle commented Jan 25, 2024

@casperisfine I've shared some thoughts in rails/rails#50864 (review), but it seems like the public API around strict and implicit locals is insufficient for templating engines.

I believe that'll take some effort to resolve, so I think I'll need some help.

@dhh
Copy link
Member

dhh commented Apr 29, 2024

I'm not a fan of strict locals, and I'm not interested in them being used by default.

@dhh dhh closed this Apr 29, 2024
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.

3 participants