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

Implement fetch action #220

Open
setineos opened this issue Oct 10, 2024 · 2 comments
Open

Implement fetch action #220

setineos opened this issue Oct 10, 2024 · 2 comments

Comments

@setineos
Copy link

setineos commented Oct 10, 2024

I would like to find a solution to execute a function asynchronously. Currently this function is in the controller. For information this function allows to make all messages of a conversation as read.
There is no need for HTML response.

I thought a Custom action would be interesting. What do you think?

Action signature:

turbo_stream.fetch(url)

Example Turbo Stream Element:

<turbo-stream action="fetch" url="/conversation/7514/seen"></turbo-stream>

Afterwards, it may be that we can do otherwise, but I don't see how.

@marcoroth
Copy link
Owner

Hey @setineos, thanks for opening this issue!

This is interesting! I'm wondering if the current redirect_to/turbo_visit action would work for this too?

@setineos
Copy link
Author

redirect_to/turbo_visit actions are different from fetch. I don't see what you're getting at :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants