-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionView::Template::Error occurs when trying to render a template file with a partial #560
Comments
Hey @mpg-takahiro-koyama, I had a similar issue recently and opened PR #606. I checked it with your case and it looks fine. You can follow these steps in case you want to reproduce it:
gem "lookbook", github: "liram11/lookbook", branch: "fix-partial-rendering"
#./config/environments/development.rb
config.lookbook.preview_disable_action_view_partial_prefixes = true
And thanks for the detailed report. |
@liram11 |
Cool, thanks for double-checking it 👍 |
@mpg-takahiro-koyama I've just released v2.3.0 that contains @liram11's fix for this issue. Thanks for reporting it and for confirming the fix works for you! |
Describe the bug
The following error occurred when trying to render a template with partial as in
render template: 'articles/xxx', assigns: { xxx: }
.I think the problem is that it has a
lookbook
namespace instead ofarticles/_articles
.I tried to read the actionview/actionpack code based on stacktrace to create a PR if possible, but I got to the point where I thought the problem might be around the initialization of the
lookup_context
.However, the initialization process is so complex that I could not figure out where to fix it, so I created an issue.
To Reproduce
bin/rails generate scaffold Article title:string body:text
Expected behavior
When redering a partial, it should look for
articles/_articles
instead of under the lookbook directory, such aslookbook/articles/_articles
.Screenshots
Full stack trace
Version numbers
Please complete the following information:
Lookbook: 2.2.0
ViewComponent: -
Rails: 7.1.2
Ruby: 3.2.1p31
Additional context
The following is a sample project that is actually in error.
https://github.com/vividmuimui/LookBookSample/tree/report-issue
https://github.com/vividmuimui/LookBookSample/blob/report-issue/test/components/previews/articles/show_preview.rb
The text was updated successfully, but these errors were encountered: