Cleaner Code with the "token_list" Helper
25-Apr-2023 662
I’m pleasantly surprised when I come across a new feature or helper method that I’m not familiar with and token_list is one of those seemingly obscure methods that can really help remove conditionals from your view logic. To illustrate this, I’ll create a ViewComponent that wraps around the Bootstrap Alert component (the same principles could be applied to a Flowbite alert component as well.) Additionally, we’ll explore adding some validation and tests to the component.
Cleaner Code with the "token_list" Helper #ruby #rubydeveloper #rubyonrails #Cleaner #"token_list" #Helper #code https://rubyonrails.ba/link/cleaner-code-with-the-token_list-helper