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 turbo_frame option to redirect_to action #79

Merged

Conversation

adrianthedev
Copy link
Contributor

Adds the frame option to the redirect_to action.
Super useful for when you'd like to perform an update and a redirect using turbo streams.

I think the frame keyword argument is better suited for this rather than a positional argument, but it's up to you to set the API.

Thanks!

CleanShot 2023-08-22 at 03 11 09@2x

@marcoroth
Copy link
Owner

Hey @adrianthedev, nice one, thank you!

Regarding the API: turbo_power-rails supports both keyword and positional arguments thanks to marcoroth/turbo_power-rails#26.

So I think to keep it consistent we can add frame (or even turbo_frame to align with turbo_action) as a third optional positional argument and also have it being supported via keyword arguments.

@adrianthedev
Copy link
Contributor Author

Gotcha! Let me put the finishing touches and add some tests over the coming days.

@marcoroth
Copy link
Owner

Gotcha! Let me put the finishing touches and add some tests over the coming days.

Awesome, let me know if you need any guidance or when you get stuck somewhere 🙌🏼

@adrianthedev
Copy link
Contributor Author

I addressed your feedback.

Not sure why this test is failing.
I followed your lead when I created it.
Could you please help me out with that?

src/actions/turbo.ts Outdated Show resolved Hide resolved
Co-authored-by: Marco Roth <marco.roth@intergga.ch>
src/actions/turbo.ts Outdated Show resolved Hide resolved
adrianthedev and others added 5 commits August 24, 2023 15:58
@marcoroth marcoroth changed the title feature: add frame to redirect action Add turbo_frame option to redirect_to action Aug 24, 2023
@marcoroth marcoroth merged commit 0caaaf2 into marcoroth:main Aug 24, 2023
4 checks passed
@adrianthedev adrianthedev deleted the feature/add-frame-to-redirect-action branch August 24, 2023 18:36
@marcoroth
Copy link
Owner

Thank you @adrianthedev!

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.

None yet

2 participants