In this article, I share tips for writing Rails ViewComponents, based on my experience building RailsNotes UI, and other projects. If you use ViewComponents in your Ruby on Rails apps, read this article!
Tips (4)
- This is a super short article on how to add a favicon to your Ruby on Rails app. We combine the favicon_link_tag helper with asset_path, which makes it quick and easy.
- If you're sick of typing rails console all day, or just want to learn about a cool Rails command, I've got something that you're going to like — the rails runner command.
- This method to split your database seeds by Rails environment is clean and simple, and is perfect to split up your `seeds.rb` file. It's a brilliant method! I just wish I'd thought of it first 😅