Thanks @excid3, very neat :-) One comment though, as capturing scroll events like this is usually quite CPU-intensive, wouldn't it be better to use an
One thing I like to do these days is, instead of responding with a
create.js.erb, catch the
ajax:success event in the stimulus controller (possibly even by attaching it to
You don't get inline rendering of your Rails ivar this way, but you stay in the context of your controller and don't have to use that kind of "hacky" way of updating the form/character count, since you have access to
this.element and your targets...
I built that w/ActionCable just last week. Should I write up a blog post?