Stimulus: Nested controller folders?

Created on 24 Jan 2018  路  3Comments  路  Source: hotwired/stimulus

I didn't see anything in the documentation, so I'm curious how you would handle nested folders and how that gets written out in the data-controller values. I like the idea of using folders to group different types of controllers together (maybe pages, forms, components, etc.)

Most helpful comment

Support for namespaced controllers is coming soon in Stimulus 1.0 (#65). For example, a controller defined in users/list_item_controller.js will be automatically loaded with the identifier users--list-item.

All 3 comments

Support for namespaced controllers is coming soon in Stimulus 1.0 (#65). For example, a controller defined in users/list_item_controller.js will be automatically loaded with the identifier users--list-item.

@sstephenson That sounds awesome. Thanks!

@sstephenson @javan for some reason the nested controllers aren't being compiled in the packs-test when running a Rails system test, would that be on the Rails/Webpacker side or Stimulus?

UPD. Upgrading webpacker resolved it.

Was this page helpful?
0 / 5 - 0 ratings