default_preview_layout and Gems #1509
Replies: 2 comments 1 reply
-
@tripptuttle this sounds like a bug to me. Would you be able to provide a failing test on the repo or a separate repo that recreates the issue (using |
Beta Was this translation helpful? Give feedback.
1 reply
-
Closing as outdated. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a component library, packaged as a UI Gem, along with shared layouts and view templates. I'm trying to have previews use a skeleton layout instead of the default 'app/views/layouts/application'.
I've specified
Rails.application.config.view_component.default_preview_layout = "components"
however when trying to access the preview route from an application that uses my UI Gem, I'm getting a "Template is missing" error.Rails apparently is searching for an
app/views/layouts/components
only in a very limited set of locations ⬆️. Elsewhere in my app, I have no issue specifying non-default templates located in my Gem. I've tried changing thepreview_route
as well with no luck.From Rails guides:
My engine has that directory structure (
app/views/layouts/components.html.erb
), so I'm not sure why only in this case Rails isn't looking in my UI Gem for the template.Anyone have any thoughts, or might this be a bug?
Beta Was this translation helpful? Give feedback.
All reactions