I am confused why i dont get 2 entries when i create a new quote with the following code.
My thought is that i would get an entry from the following:
- the create method that returns the turbo_stream and renders the create.turbo_stream
- the actionCable that im subscribed to.
if i remove the stream, i still get just 1 entry. if i remove the append method in create.turbo_stream, i still get one entry ( from the cable)
WHY DONT I GET 2 with both enabled?
controller:
In create i have a response type of format.turbo_stream.erb
along with the html response type.
create.turbo_stream.erb:
<%= turbo_stream.prepend "quotes", @quote %>
<%= turbo_stream.update Quote.new, "" %>
View
<%= turbo_stream_from( [current_company, "quotes"] ) %>
Quote model broadcast:
broadcasts_to ->(quote) { [quote.company, "quotes"] }, inserts_by: :prepend