BestWeb VenturesforBestWeb Ventures's Blogblog.bestwebventures.in·Nov 5, 2024Rails View Patterns: Helpers vs Partials vs Presenters vs DecoratorsAs Ruby on Rails applications grow in complexity, maintaining clean and organized views becomes increasingly challenging. Rails provides several patterns to help manage this complexity: Helpers, Partials, Presenters, and Decorators. Each serves a spe...2 likes·287 readspresenters
BestWeb VenturesforBestWeb Ventures's Blogblog.bestwebventures.in·Oct 30, 2024Turbo Frames in Rails: A Complete Guide to Lazy-Loaded ComponentsWhat is Lazy Loading with Turbo Frames? Modern web applications need to be both performant and maintainable. In Rails applications, we often face the challenge of loading multiple independent widgets or components on a single page. While traditional ...177 readsviewcomponent
BestWeb VenturesforBestWeb Ventures's Blogblog.bestwebventures.in·Oct 29, 2024ViewComponent vs Phlex vs Partials: A Comprehensive Comparison in Ruby on RailsIn the world of Ruby on Rails, developers are often faced with the task of managing the presentation layer of their applications. This is where the choice of view management strategy becomes crucial. Three popular approaches are ViewComponent, Phlex,...338 readsphlex
Alvin Crespoalvincrespo.hashnode.dev·Aug 13, 2024Testing ViewComponent w/ CapybaraToday I was writing some tests and dug into a little bit of ViewComponent and Capybara. Most of time you read a tutorial and just kind of get whatever done, here I'm going to explain in detail what my test is doing and why it's important. 💡 If you'...29 readstrix-editor
Andrew Fosterandrewfoster.hashnode.dev·Aug 30, 2022Calendar component using ViewComponent and HotwireTailwindUI has a nice looking calendar component I can use for this task. Here is what it will look like: And here is the component in action being used to set a value for a date input: https://www.loom.com/share/5aba00620a15484baa3f7a6fb08f617d Let...1 like·824 readsLearn MoreRuby on Rails
Andrew Fosterandrewfoster.hashnode.dev·Jun 30, 2022Modal for Adding RecordsAt the moment the only way to add new records is using the scaffolded "New" page. Not only is it pretty uninspiring to look at it, using it means navigating away from the index page to do so. Instead I'll let users add records directly from the inde...76 readsRails 7 ApplicationRuby on Rails
Andrew Fosterandrewfoster.hashnode.dev·Jun 23, 2022Filtering and Sorting with RansackAt the moment the index pages for the application show all available records and have no way to filter, search or sort at all. In this blog I'll tackle the filtering and sorting aspects with a tool I have used before called Ransack. I have not seen a...2 likes·2.4K readsRails 7 ApplicationRuby on Rails
Andrew Fosterandrewfoster.hashnode.dev·Jun 20, 2022Encapsulating the UI with ViewComponent + StorybookSo far the user interface for my application has been built using a combination of views (including partial views) and helper methods. An alternative exists called ViewComponent. This is a way of encapsulating a single user interface element into a r...341 readsRails 7 ApplicationRuby on Rails