turbo_power icon indicating copy to clipboard operation
turbo_power copied to clipboard

Implement `fetch` action

Open setineos opened this issue 1 year ago • 2 comments

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.

setineos avatar Oct 10 '24 07:10 setineos

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?

marcoroth avatar Oct 15 '24 01:10 marcoroth

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

setineos avatar Oct 23 '24 07:10 setineos