Nested Attributes & Validation In Ruby On Rails 7

preview_player
Показать описание
Give clients an address and validate the address in under 10 minutes!

This tutorial covers nested attributes and validation in a very simple Ruby on Rails 7 application.

Join this channel to help support these videos:

Follow me on social media:

#Deanin #Software #Programming
Рекомендации по теме
Комментарии
Автор

100 subscribers away from 10k. That means I might have to start uploading real content soon 😱😱

Deanin
Автор

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 👍

holgera
Автор

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.

andreseduardo
Автор

Congrats on 10k! Well deserved and highly underrated channel, I hope nothing but continued success for you in 2023 and onwards! 🚀

muronuck
Автор

Thanks a bunch. This helps the community. 👍

KrishnaDiamesso
Автор

thanks a lot, this is exactly what I'm working on right now :D

eternaleclipse
Автор

Thank you! Would love to see a video on devise user with nested models (user.profile, for instance)

ashleykdev
Автор

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

snailprogrammer
Автор

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.

MattBudz
Автор

@Deanin... If I may ask, what extensions are you using for code completion with rails?

anthonypetruzzi
Автор

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.

nyaorobenjamin
Автор

Hey! What about error display for multiple addresses?

delcatta
Автор

Can you create a video for mvvm architecture

roshankanel
Автор

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.

giordanodiaz
Автор

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 think you imagination can create more usefull thin

ddd