filmov
tv
ViewComponent Crash Course with Ruby on Rails

Показать описание
ViewComponent is a powerful gem that allows you to create reusable, testable, and encapsulated view components in Ruby on Rails applications.
ViewComponent was developed by the GitHub team and has since been adopted by many developers looking for more structure than the default partials and helpers provided by Ruby on Rails. This crash course will review ViewComponent's use case and explore how it might fit your next Rails app.
Timestamps:
00:31 - What is ViewComponent
01:30 - Benefits of ViewComponent
03:00 - Create a new Rails app
04:00 - Add ruby gems
04:15 - Basic app configuration
11:43 - Generate first ViewComponent
13:00 - Add application component
14:25 - ButtonComponent setup
18:15 - Add Tailwind CSS, component classes
19:44 - Rendering a ViewComponent
22:29 - Generate and configure BlogPostComponent
28:03 - Generate and configure AvatarComponent
31:39 - ViewComponent Slots
32:40 - Generate Nav-based components and LogoComponent
37:33 - Render navigation components with slots
41:05 - ViewComponent Tests
43:58 - Final thoughts and opinions
======
⚡️Upcoming FREE course - Reserve your spot now and get on the mailing list.
💻 Read the written version:
💎 New to Ruby on Rails? Enroll in my course HELLO RAILS:
Additional Links:
Also, this stuff takes a long time to make, but I love to do it. To help me keep at it, consider supporting me. If not monetarily, subscribe to the channel or share it with someone!
ViewComponent was developed by the GitHub team and has since been adopted by many developers looking for more structure than the default partials and helpers provided by Ruby on Rails. This crash course will review ViewComponent's use case and explore how it might fit your next Rails app.
Timestamps:
00:31 - What is ViewComponent
01:30 - Benefits of ViewComponent
03:00 - Create a new Rails app
04:00 - Add ruby gems
04:15 - Basic app configuration
11:43 - Generate first ViewComponent
13:00 - Add application component
14:25 - ButtonComponent setup
18:15 - Add Tailwind CSS, component classes
19:44 - Rendering a ViewComponent
22:29 - Generate and configure BlogPostComponent
28:03 - Generate and configure AvatarComponent
31:39 - ViewComponent Slots
32:40 - Generate Nav-based components and LogoComponent
37:33 - Render navigation components with slots
41:05 - ViewComponent Tests
43:58 - Final thoughts and opinions
======
⚡️Upcoming FREE course - Reserve your spot now and get on the mailing list.
💻 Read the written version:
💎 New to Ruby on Rails? Enroll in my course HELLO RAILS:
Additional Links:
Also, this stuff takes a long time to make, but I love to do it. To help me keep at it, consider supporting me. If not monetarily, subscribe to the channel or share it with someone!