I'm coming back to rails for the first time since Rails 4. Thank you for everything you are doing to support the Rails ecosystem and in particular Rails 7!
Great video. Many thanks to the author! A few notes: 1) Stimulus action without bind function: this.submit = debounce(this.submit, 300) submit = () -> { this.element.requestSubmit() } Like this: github -> secretpray (Hotwire-CRUD-MODAL) in search_controller.js 2) I would also add search launch only after two characters entered, reset search results (in turbo_frame), user search history.
I'm from a Django background and I'm studying ruby but I was curious about how things are done in Rails I see this video just for curiosity and I like that so much because it's so simple!
This was really great, thank you. I'm currently trying to learn Hotwire after Angular, which is a very different mental model. Seeing the search form work in combination with turbo-frames and the search action on the main controller was great. But, I've also run into issues where Hotwire requires a Form post to result in a Location redirect (or throws an error). I see in your demo that you're using a GET request; I assume this is (in part) to get around this issue (and in part to make the URL shareable). Just wondering if you have any advice for something like this where it has to be a POST... though, I guess I could use a turbo-stream at that point. Anyway, awesome stuff!
@@mixandgo In this case, you're re-rendering the same page with the form submission. Turbo Drive requires POST requests to either result in an error or in a 3xx page redirect. But, by using the GET request, you can get around that limitation. Unless, you respond with a Turbo Stream. Anyway, I don't mean to go off on a tangent. It's a great video - this stuff is just swimming around in my brain.
I'm coming back to rails for the first time since Rails 4. Thank you for everything you are doing to support the Rails ecosystem and in particular Rails 7!
Welcome back Jordan :) A lot has changed since v4.
Really like your explanation here, very clear and you didn't rush through things too fast. Was able to get search in my app up and running in no time!
Thank you
Great video. Many thanks to the author!
A few notes:
1) Stimulus action without bind function:
this.submit = debounce(this.submit, 300)
submit = () -> {
this.element.requestSubmit()
}
Like this: github -> secretpray (Hotwire-CRUD-MODAL) in search_controller.js
2) I would also add search launch only after two characters entered, reset search results (in turbo_frame), user search history.
Thank you for your suggestions
Loved the debounce hint.
I'm glad you found it helpful.
thank you for the video, you just made it all click in my head.
Glad to hear it
Excellent video. Thank you!
Thank you
Very useful video. Thx for sharing!
Thank you
Nice one and super helpful. Thanks for sharing!
Glad it was helpful!
amazing tutorial men!!
Thanks man
debounce part pretty interesting
Amazing, thank you
You're welcome :)
I'm from a Django background and I'm studying ruby but I was curious about how things are done in Rails
I see this video just for curiosity and I like that so much because it's so simple!
Yes, that's what attracted a lot of people to it.
This was really great, thank you. I'm currently trying to learn Hotwire after Angular, which is a very different mental model. Seeing the search form work in combination with turbo-frames and the search action on the main controller was great. But, I've also run into issues where Hotwire requires a Form post to result in a Location redirect (or throws an error). I see in your demo that you're using a GET request; I assume this is (in part) to get around this issue (and in part to make the URL shareable). Just wondering if you have any advice for something like this where it has to be a POST... though, I guess I could use a turbo-stream at that point. Anyway, awesome stuff!
I'm not sure I understand your question. Is there a reason you cannot use a POST?
@@mixandgo In this case, you're re-rendering the same page with the form submission. Turbo Drive requires POST requests to either result in an error or in a 3xx page redirect. But, by using the GET request, you can get around that limitation. Unless, you respond with a Turbo Stream. Anyway, I don't mean to go off on a tangent. It's a great video - this stuff is just swimming around in my brain.
I did not try Hotwire yet but was curious can we apply this in api only application of rails
Not really. It's for building UIs.
You loaded the denounce using yarn. Do you need to use webpacker to load the JS? I thought rails 7 uses import maps to load JS dependencies?
You don't need to, but the option is still available.