Ruby on Rails Forms With Hotwire

  Рет қаралды 7,430

Mix & Go

Mix & Go

2 жыл бұрын

I wanted to find out if Hotwire can be as good, or better than something like React JS. I want to know if can build a form that looks good and make it feel super responsive. But... I wasn't sure if Hotwire is up to it. So we're going to put that to the test.
🎥 Join my new Ruby on Rails Class here: mixandgo.com/rails-class
👉 Buy my Bulletproof Ruby on Rails Applications eBook: j.mp/2OtFCdR
Link to the code repo: github.com/mixandgo/hotwire_f...
You can subscribe to the channel using this link: kzbin.info?sub_...
My website: mixandgo.com
#rubyonrails #rails7 #hotwire #stimulusjs #turbo #ruby #webdev

Пікірлер: 28
@devdevdevdev
@devdevdevdev Жыл бұрын
Awesome video, keep the good work!
@mixandgo
@mixandgo Жыл бұрын
Thank you.
@oooo9570
@oooo9570 2 жыл бұрын
Yes this is what the rails community needs a revival esp. with what turbo-streams has to offer. Would you be willing to put any of this video related code on public repo?
@mixandgo
@mixandgo 2 жыл бұрын
I might, I'm not sure yet.
@edmundo5450
@edmundo5450 2 жыл бұрын
Very nice! This is what Im looking for. A form and list example using hotwire. Thank you!
@mixandgo
@mixandgo 2 жыл бұрын
You're very welcome!
@edmundo5450
@edmundo5450 2 жыл бұрын
@@mixandgo When the form is on edit, the field values are not blanked or reset to fields placeholders (i.e. "Your firs name" etc) after clicking Save. How to do it? Thanks again.
@mixandgo
@mixandgo 2 жыл бұрын
@@edmundo5450 yes, that is intentional, since you're still editing (if you look at the URL, you see the ID of the record you're editing). Reset doesn't make sense (to me), but to do it you'd need to clear the form in the `update.turbo_stream.erb` template just like I did in the `create` template (i.e. render the form with a Contact.new as the contact local variable). I think it makes more sense to redirect to a different page, like /contacts/new in order to display an empty form. Hopefully, that makes sense.
@edmundo5450
@edmundo5450 2 жыл бұрын
@@mixandgo It works!! Thanks a lot.
@mixandgo
@mixandgo 2 жыл бұрын
You're welcome :)
@tmszcncl
@tmszcncl 2 жыл бұрын
Great video - thanks :) What do I need to 'play' with hotwire? Does it really require sidekiq and redis on production?
@mixandgo
@mixandgo 2 жыл бұрын
Are you planning on using ActionCable? If so you're going to need Redis. But you can use hotwire without ActionCable, if you don't need to broadcast updates.
@celsomartins2293
@celsomartins2293 2 жыл бұрын
Nice video. Could you please show your routes.rb? Are you using put or patch to update or just post? Thank you.
@mixandgo
@mixandgo 2 жыл бұрын
You can check out the repository (in the description).
@nelsonchavespro
@nelsonchavespro 2 жыл бұрын
Thanks for posting these! I've been watching all your videos. I have a suggestion. One is creating a group, like a facebook groups, where people can join and comment and get notifications, also be able to make that group public, private, or secret. And also be able to make another user like a group admin. The other suggestion is upgrading to Rails 7 and removing webpacker.
@mixandgo
@mixandgo 2 жыл бұрын
Thanks for your suggestion Nelson. Would that group be different from KZbin (where you can comment and get notifications)? What would be the utility of the group?
@nelsonchavespro
@nelsonchavespro 2 жыл бұрын
@@mixandgo oh I'm not familiar with youtube groups. The utility of the group is to share information and ask questions to help each other out. for example i am in a Toyota 4runner group in facebook. where people can comment, share photos, or ask questions on how to fix their car and people can comment on your post. The admin can kick people out or make other people admin as well so people don't post selling ads. and the group is private. you can ask to join and the admin will let you in. sometimes you just answer some questions and they let you automatically. I'm guessing the groups can have 3 different choices like public, private, or secret
@chrisrobbo
@chrisrobbo 2 жыл бұрын
@@nelsonchavespro I would join :)
@mixandgo
@mixandgo 2 жыл бұрын
@@nelsonchavespro oh I was just referring to the regular comments section and notifications that KZbin provides (sorry if that was confusing). I see what you mean now, I do plan to create such a group for the members of the Rails course I'm building, but I haven't thought about a public one.
@davidcordero9864
@davidcordero9864 Жыл бұрын
After cloning the repo and running bundle I got an error. The asset "application.css" is not present in the asset pipeline. Any ideas what I can do?
@mixandgo
@mixandgo Жыл бұрын
Have you tried running yarn? and then ./bin/dev
@davidcordero9864
@davidcordero9864 Жыл бұрын
@@mixandgo That worked for me thank you Cesar!
@mixandgo
@mixandgo Жыл бұрын
@@davidcordero9864 happy to hear that
@jensdisselhoff8109
@jensdisselhoff8109 Жыл бұрын
Apart from all the turbo stuff, I really like the inline_error_for helper. Neat!
@mixandgo
@mixandgo Жыл бұрын
Thanks Jens, glad you liked that.
Refactoring Turbo Streams into Turbo Frames
10:54
GoRails
Рет қаралды 3,6 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 15 МЛН
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 30 МЛН
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 26 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 58 МЛН
Introduction to Hotwire in Ruby on Rails
10:17
Mix & Go
Рет қаралды 19 М.
Turbo Frames vs. Turbo Streams
8:25
Mix & Go
Рет қаралды 16 М.
Hotwire Demystified - Jamie Gaskins
34:18
Ruby Central
Рет қаралды 11 М.
Ruby on Rails #63 Hotwire Modals (the right way)
21:15
SupeRails
Рет қаралды 9 М.
Hotwire: The Demo
12:55
Getting Real
Рет қаралды 37 М.
5 Secrets to Becoming a Badass Ruby on Rails Developer
28:01
Mix & Go
Рет қаралды 21 М.
ONE MORE SUBSCRIBER FOR 6 MILLION!
00:38
Horror Skunx
Рет қаралды 15 МЛН