Yeah so if you just pass through the object, you’ll get the same partial back. Because you’ve just passed a model, Rails has to assume you want the model partial. Rails only knows what the partial is calling a method (to_partial_path) on your model. By default, that returns something like questions/question, which is how your _question.html.erb partial is working.
But that’s just shorthand. You can simply tell Rails what partial you want: <%= render "questions/whatever", question: some_way_to_access_the_question %>.
It looks like you have a collection, though. So there’s another permutation: <%= render collection: @live_room.room.questions, partial: "questions/whatever" %>. That will render the questions/whatever partial for each question. But one point of caution: the name of the question variable that’s exposed to you in the partial is, by default the name of the partial. So in my example, it’d be whatever and you’d do whatever.created_at, or something. That can be awkward so you can customise the name of the variable by sending an as parameter, like so: <%= render collection: @live_room.room.questions, partial: "questions/whatever", as: :question %>. Now you can do question.created_at and so on.
This is more of a Rails question than a Hotwire / Stimulus question. You can check out the Rails docs on all things rendering here.
When it comes to broadcasting with Hotwire, the broadcasts methods (broadcasts_replace_to and friends) accept some of the same options you can pass to render. They take a partial argument. So your broadcasting, extending the example above, may look something like: broadcasts_append_to :quesions, partial: "questions/whaetever".
Presumably, on rooms/show, you have a turbo_stream_from @room call? I think you just need to copy that to live_rooms/show. Turbo will broadcast to wherever you’re streaming from.
It’s hard to say what the problem is there without being able to see your app. But Turbo should stream to anywhere where you stream from the same live_room you’ve set up in your broadcast callbacks. It doesn’t matter you have two different pages streaming the same thing.
Is there a way to stop Hotwire from rendering the id="questions" from questions/question with to_partial_path ?
When broadcasting the render collection: code you shared, the object gets broadcasted from questions/question and only show’s the partial questions/whatever once the page has been refreshed, or if the questions/whatever is already on the page.