4 ms·
As someone who is only vaguely familiar with Rails and doesnt really know anything about stimulus, it would be nice to have a "What this looks like" section wit
by yuppiepuppie 6y ago
As someone who is only vaguely familiar with Rails and doesnt really know anything about stimulus, it would be nice to have a "What this looks like" section with a gif of what the user sees. Otherwise, I dont know what this article is talking about. Im interested as there is probably some application to my daily work, but a wall of code and words doesnt tell me much very quickly.
- tpetry 6y agoIt‘s just some ajax logic: Put something in a form, an ajax request will be made an the response is inserted into the dom. The title is pure clickbait, it‘s nothing more than a simple ajax call. The type of logic you‘ve done 10 years ago with a little bit of jquery.
- strzibny 6y agoPlease enlighten me what would be your title for the post? The idea is making a reusable Stimulus 2 controller.
- strzibny 6y agoI just added it. The preview text will become bold, but the idea is that you can send any kind of HTML to inject.
- yuppiepuppie 6y agoGreat job! Now I get it!
- swanson 6y agoI think the article would be better if you were to include even a basic template instead of just adding the <strong> tag. Right now, my first impression would be "why not just wrap the content in <strong> in JS instead of making a network request on every keystroke?" The benefit of being able to reuse the server template logic isn't being demonstrate because of the simplicity of the example.
- strzibny 6y agoI was thinking of that, but I think the point is that you do any transformation in Ruby. I focused on how to do that. Thanks for the feedback.