Stas Syritsyn

Joined

20 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in How to use Hotwire in Rails Discussion

Thanks for the vid, Chris!

Didn't actually get one thing. For some reason, I can't afford broadcasting with a model callback (like it's shown in the lesson), and I therefore need to broadcast from the controller action.

I checked the docs, and here's how I made it:

...
if @tweet.save
format.turbo_stream do
render turbo_stream: turbo_stream.prepend(:tweets, partial: "tweets/tweet",
locals: { tweet: @tweet })
end
format.html { redirect_to tweets_url, notice: 'Tweet was successfully created.' }
format.json { render :show, status: :created, location: @tweet }
else
...

This approach works pretty much like the original from the lesson, but! The new tweets don't appear in another browser tab! New tweet does show up on the author's tab, but on any other tab/browser/device -- it simply doesn't.

Frankly, I didn't really spend much time digging in the docs, did I miss anything maybe?

Best.

Posted in Anyone with experience using Quilljs?

Just in case anybody's from 2020.
Take a look here https://www.kohrvid.com/blog/posts/using-quilljs-with-rails-6

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.