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

Replacing two distinct parts of the page with a GET request through a link. #217

Closed
rockwellll opened this issue Mar 26, 2021 · 2 comments
Closed

Comments

@rockwellll
Copy link

HI.

So. basically i have this

image

What i want is, that when you click on a conversation of the left side.

  • it will perform a GET request to the server
  • Render back two turbo-stream tags to replace parts of the DOM.

But, currently i just cant wrap my head around it and can't get it to work.

The requests made via the link are always processed as HTML. Meaning i get a blank page like this

This is what i responed with

  def show
    render layout: false, content_type: "text/html; turbo-stream"
  end

image

My problems are

  • i don't know how can i make the links send requests as TuboStreams
  • Dont know how to replace these two elements.

NOTE
i know that using target=_top will solve that. but the page does some heavy calculations, so unfortunately that's not possible.

I have also looked at #56 but with no luck.

Thanks

@tleish
Copy link
Contributor

tleish commented Mar 26, 2021

@A7madXatab - I suggest closing this ticket (which isn't a bug or feature request) and posting your question to https://discuss.hotwire.dev/. You will likely get the help you are looking for.

@rockwellll
Copy link
Author

Aggreed, figured that out. Sorry. For future reference.

You can find the same question on https://discuss.hotwire.dev/t/using-turbo-stream-and-turbo-frame-with-get-requests-solved/2603/2.

And the solution hotwired/turbo-site#40 (comment)

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

No branches or pull requests

2 participants