Menu

Contributing to maquina-components: Two PRs From Day One
📰

Contributing to maquina-components: Two PRs From Day One

DEV Community: rails·Juan Vasquez·3 days ago
#PpK4YJT4
#devtorails#devto#dev#helper#engine
Long article (1129 words) — no AI summary yet.
Reading 0:00
15s threshold

While installing maquina-components in my project, I hit a NoMethodError for sidebar_open? . What started as “maybe I’m doing something wrong” turned into a deep dive into how Rails engines handle helpers, a wrong first fix, and eventually two PRs: one fixing a bug and another adding a feature.

The Bug

After running the install generator and adding the sidebar to my layout, I got:

undefined method 'sidebar_open?' for an instance of #<Class:...>

Enter fullscreen mode

Exit fullscreen mode

The generated MaquinaComponentsHelper had wrapper methods like app_sidebar_open? that delegated to sidebar_open? , but sidebar_open? lives in MaquinaComponents::SidebarHelper . That module was never included.

Why It Happens

Rails engines auto-include helpers from app/helpers/ , but only top-level ones.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.