Nested Attributes & Validation In Ruby On Rails 7

  Рет қаралды 5,834

Deanin

Deanin

Күн бұрын

Пікірлер
@Deanin
@Deanin 2 жыл бұрын
100 subscribers away from 10k. That means I might have to start uploading real content soon 😱😱
@Deanout
@Deanout 2 жыл бұрын
Don't do it! You have so much to live for 😭
@developerfoe
@developerfoe 2 жыл бұрын
Is there any way that we accpet and update nested attributes on basis of UUID (which should not be primary key) instead of ID.. just like here we specify ID but what if we want to specify uuid on which it find records and update them .. but the constraint is UUID should not be the primary key (primary key must be ID). Any reply would be more than welcome.
@Deanin
@Deanin 2 жыл бұрын
I'll take a look at using UUID instead. No guarantees, because I'll be making the solution from scratch lol.
@MattBudz
@MattBudz 2 жыл бұрын
HAHA I love that you have both Deanin and Deanout channels 😆Keep it up dude great work! 10k this weekend then you'll be on the road to 100k in no time!
@Deanin
@Deanin 2 жыл бұрын
Haha, I grabbed both after I started learning C++'s cout and cin syntax. Appreciate it though. Ending the year on 10k was a good feeling, and good motivation for 100k
@holgera7170
@holgera7170 2 жыл бұрын
Hey since I started to deal with rails again after the new version 7 was released I watched your videos... great work, very professional, but still with humor 😉 keep going 👍
@andreseduardo5991
@andreseduardo5991 Жыл бұрын
In case you're wondering as I was: For one-to-many associations, i.e: `Client` has many `Addresses` what you'd want to do in the `clients#new` action is ``` # clients_controller.rb def new @client = Client.new @client.addresses.build # instead of @client.build_address end ``` Thanks for this video I was missing that little line.
@muronuck
@muronuck 2 жыл бұрын
Congrats on 10k! Well deserved and highly underrated channel, I hope nothing but continued success for you in 2023 and onwards! 🚀
@MattBudz
@MattBudz 2 жыл бұрын
Awesome, you wasted no time haha. Lots of newer devs get tripped up by this. Another great exercise along these lines is to add nested attributes dynamically. For example, have an Author model and a Book model. Then give users the ability to add N Books while creating or updating the Author. This can be done nicely now with turbo frames. There are gems like cocoon that do this but it's always nice to understand how things work rather than relying on a gem to spoil all the fun.
@Deanin
@Deanin 2 жыл бұрын
Yeah this is definitely one that I wasted a lot of time on while learning. I'll add it to the list as well. Agreed on understanding how it works, as that's also really helpful if those gems end up being deprecated lol.
@MattBudz
@MattBudz 2 жыл бұрын
lol deprecated gems are the bane of my existence! I try to use as few gems as possible unless they are reputable gems with a long standing history of active development. Oh there's a gem that does the thing! *adds gem* 🎉 6 months later: oh this rails update is causing my specs to fail? *checks specs* Oh I need up also update that gem, goes to the gem's repo: *last commit 48395674938 years ago* 🤬
@KrishnaDiamesso
@KrishnaDiamesso Жыл бұрын
Thanks a bunch. This helps the community. 👍
@ashleykdev
@ashleykdev 2 жыл бұрын
Thank you! Would love to see a video on devise user with nested models (user.profile, for instance)
@OnurBaranTR
@OnurBaranTR 2 жыл бұрын
Thanks for all the efforts.
@eternaleclipse4943
@eternaleclipse4943 2 жыл бұрын
thanks a lot, this is exactly what I'm working on right now :D
@ranjithaa7415
@ranjithaa7415 Жыл бұрын
did this work for you
@eternaleclipse4943
@eternaleclipse4943 Жыл бұрын
@@ranjithaa7415 I think it did, but I decided that it doesn't really suit my needs, so I ended up rewriting everything and going with a completely different approach that doesn't make use of nested attributes.
@snailprogrammer7483
@snailprogrammer7483 7 ай бұрын
Your mini tutorials are awesome! Is it possible to do a datalist from one model to another with nested? Been stuck on it for a while. Basically, a list of people in a person model and assign a person to a room. Collection select sucks cause you can’t search. Person would be the datalist inside of the room form. Full break down: Person has name, Room has room_number. Billet has person references, room references and checkin/out date. Cant get person attached to billet when using datalist. Hope that makes sense
@anthonypetruzzi158
@anthonypetruzzi158 2 жыл бұрын
@Deanin... If I may ask, what extensions are you using for code completion with rails?
@Deanin
@Deanin 2 жыл бұрын
TabNine (free) and GitHub Copilot ($10/month and you have to sell your soul to Microsoft)
@delcatta
@delcatta Жыл бұрын
Hey! What about error display for multiple addresses?
@roshankanel3954
@roshankanel3954 11 ай бұрын
Can you create a video for mvvm architecture
@nyaorobenjamin
@nyaorobenjamin 2 жыл бұрын
Hi Deanin, thanks for all the efforts you make to explain stuff in your tutorials. Would you have an idea on how to implement the Google blockly games to a rails 7 app. Would be really nice if you did a tutorial like the one you did with Godot. Thanks.
@Deanin
@Deanin 2 жыл бұрын
I'll take a look at it! This is the first I've heard of Blockly, but it seems very interesting. Hopefully I'll have something out on Thursday.
@giordanodiaz5047
@giordanodiaz5047 2 жыл бұрын
Hi thanks for the awesome tutorial, can you make a tutorial using devise and pundit gem for security polices? Something like just users with role creators can create posts and just admin can edit user info.
@ddd2283
@ddd2283 2 жыл бұрын
Can you discover "dark side" of Ruby planet? I mean Ruby zoo - C-ruby, Jruby(9.4 covered Rails 7) and GraalVM with TruffleRuby(allow to use C-extentions on java-machine and call another languages such as Python from Rails(you can show pandas or numpy called from Rails or another)).....I think you imagination can create more usefull thin
@azizdevfull
@azizdevfull 2 жыл бұрын
so good : )
Running Multiple Databases In Ruby On Rails 7
12:28
Deanin
Рет қаралды 4,9 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Nested Forms in Rails
18:13
TypeFast
Рет қаралды 1,5 М.
Rails Concerns vs. Modules and when to use each
13:18
webcrunch
Рет қаралды 2,1 М.
Has many through associations in Ruby on Rails
15:21
CJ Avilla (cjav_dev)
Рет қаралды 4,6 М.
All the ways to render partials in Rails
17:11
webcrunch
Рет қаралды 937
Is ViewComponent the Future of Rails?
12:25
Mix & Go
Рет қаралды 8 М.
Learn the basics of using Rails Hotwire and Turbo
8:37
ScaleRotate
Рет қаралды 6 М.
Pundit Gem For Authorization In Ruby On Rails 7
21:27
Deanin
Рет қаралды 8 М.
Episode #070 - Nested Forms from Scratch
9:53
Drifting Ruby
Рет қаралды 25 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН