Skip to content

[LiveComponent] Add missing default action in docs #415

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

Closed
wants to merge 1 commit into from

Conversation

maartendekeizer
Copy link
Contributor

Add missing default action in docs about FormCollection example. Without you got an error after copy pasting the example; resulting in bad DX.

Q A
Bug fix? no
New feature? no
Tickets n/a
License MIT

Other option is to use the DefaultActionTrait but I think it is better to hint developers about the fact that you need to set #[Security]-attributes.

about FormCollection example. Without you got an error after copy pasting the example; resulting in bad DX.
@weaverryan
Copy link
Member

Thanks for this - definitely want to get this fixed.

But, we should use the DefaultActionTrait. If you want to add the Security attribute it should be done above your class - that way it'll apply to all actions (the default re-render action, but also any custom actions... though you could add additional Security attributes to those methods if you need even strong security for one action).

Could you refactor to use the trait?

@weaverryan
Copy link
Member

Whoops - nevermind - I just saw that #411 just fixed this also. But thanks for the PR!

@weaverryan weaverryan closed this Aug 9, 2022
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.

2 participants