Ruby on Rails #80 Dynamic Forms with Turbo (not JS approach)

  Рет қаралды 6,788

SupeRails

SupeRails

Күн бұрын

Пікірлер: 30
@DanielHernandoGilRomero
@DanielHernandoGilRomero Ай бұрын
Thanks for the guide! Good job.
@andreasandres
@andreasandres 2 жыл бұрын
bro, i think you're a modern version from ryan bates or even better.. love your tutorial, i learned much from here..
@SupeRails
@SupeRails 2 жыл бұрын
Hello Andre! Thanks a lot! I’m trying my best 🤠
@ledockol
@ledockol 2 жыл бұрын
Дуже цікаво. Деякі речі, наприклад вбудований турбо стрим, це взагалі щось нове! Дуже за це дякую) Разом з тим, якщо вже використовуємо стімулус, то додаткова кнопка форми зайва. Додати ще одно value і сформувати запит безпосередньо у стімулус контролері, у заголовок додати очікувану відповідь у турбо стрим форматі. Одночасно цим же контролером можно контролювати зміст парамс, щоб не виводити зайвого у строчці браузера. Ярослав, ще раз дякую! Подивився як чашку гарної кави випив) Слава Україні!
@SupeRails
@SupeRails 2 жыл бұрын
Вітаю! Чи міг би ти показати що ти маєш на увазі у форматі gist? :)
@ledockol
@ledockol 2 жыл бұрын
@@SupeRails Звісно.
@cmthimmaiah
@cmthimmaiah Жыл бұрын
Thank you,very clearly explained
@diegogarciaspino6048
@diegogarciaspino6048 2 жыл бұрын
very clear, strong base, loved
@mariners_platter
@mariners_platter 2 жыл бұрын
I enjoy your content! Thanks so much!
@danielfonsecadasilva396
@danielfonsecadasilva396 2 жыл бұрын
I love you! thanks
@MarkWeiser
@MarkWeiser 2 жыл бұрын
Great tutorial, but I hit 2 issues: 1. simple_form does not let me create a button with get action on form (might have to bypass simple_form) 2. i got around the first problem by creating a submit button with a different commit parameter, and catch the submission in the create controller method: " if params[:commit].eql? 'validate' return render :new end" however the submit will not be invoked if html 5 is validating required fields Any ideas?
@hass89
@hass89 2 жыл бұрын
How can this be used with nested form fields (accepts_nested_attributes_for)?
@SupeRails
@SupeRails 2 жыл бұрын
if you want to "add/remove" nested fields, you would need something else. like gem vanilla_nested, or some other solution
@1990EAM
@1990EAM Жыл бұрын
How do you show validation errors using turbo?
@ddd2283
@ddd2283 2 жыл бұрын
Hi Yaroslav! Can you explain turbo + action_cabe integration in some video. Thanks!
@SupeRails
@SupeRails 2 жыл бұрын
I wish I could 😂 I'll put it on the backlog +
@ddd2283
@ddd2283 2 жыл бұрын
@@SupeRails I saw it in book "modern frontend for ruby on rails" but your english more undestanable for me )))). In this book author show some intresting thing as "stimulate". I think you can explain better )))
@ddd2283
@ddd2283 2 жыл бұрын
I was wrong about naming this technology , I mean StimulusReflex , this example official kzbin.info/www/bejne/moHdp2WnqM9ogpo
@ddd2283
@ddd2283 2 жыл бұрын
Anyway , still waiting your awesome explanation😀
@SupeRails
@SupeRails 2 жыл бұрын
@@ddd2283 oh, got it! I'm aware of stimulus reflex, and I know that it can do similar things as hotwire/turbo. However I don't have enough practical experience with it to be able to cover it in a good video at the moment. SR sure is on my TODO list for when I know it well enough :)
@baotranphi1238
@baotranphi1238 2 жыл бұрын
Can u make a video about active storage and presigned url s3 upload?
@germancruz6484
@germancruz6484 2 жыл бұрын
what's the shortcut to back to the terminal
@SupeRails
@SupeRails 2 жыл бұрын
alt+tab? did I understand your question correctly? 😄
@pftg
@pftg Жыл бұрын
It's more like an hack! You can avoid hidden button click at all.
@SupeRails
@SupeRails Жыл бұрын
Hey Paul! I wouldn't call it a hack. It's quite a reliable approach, leveraging only normal http requests and Hotwire
@MatthewKennedyUK
@MatthewKennedyUK 2 жыл бұрын
How do you deal with the edit side and persisting the params? Maybe use @post.assign_attributes(post_params)
@SupeRails
@SupeRails 2 жыл бұрын
interesting question. in this scenario where “new” and “edit” share the same form, I suppose it’s still ok to submit the “form.button” to “new_post_path”. If I create a record and open the edit form, everything seems to be working ok
@SupeRails
@SupeRails 2 жыл бұрын
Ok, I see an issue: when you go to "edit" and refresh the page, the selection can look "broken". I will show my solution in episode #82
@SupeRails
@SupeRails 2 жыл бұрын
Ok now I really understand where you were going. assign_attirbutes seems to be a good solution. I've used it today for a PR at work where I had to partially update an "Edit" form and worked very well
@clementblgr6498
@clementblgr6498 2 жыл бұрын
Dont forget to enter this command after creating a stimulus controller : ./bin/rails stimulus:manifest:update
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Dynamic Select Fields in Rails using Hotwire
19:46
GoRails
Рет қаралды 25 М.
Ruby on Rails #60 Hotwire Turbo Streams Autocomplete Search
27:28
Nested Forms with Form Objects
23:52
TypeFast
Рет қаралды 670
5 Secrets to Becoming a Badass Ruby on Rails Developer
28:01
Mix & Go
Рет қаралды 25 М.
Nested Forms in Rails
18:13
TypeFast
Рет қаралды 1,5 М.
Turbo Frames vs. Turbo Streams
8:25
Mix & Go
Рет қаралды 19 М.