Error reporting with invalid partial
Reported by Max Aller | May 14th, 2008 @ 09:17 PM | in 0.9.4
When executing the method 'partial' with a template that merb can't find, it gives the rather uninformative error 'nil is not a symbol'. A 'template not found', 'partial not found', or 'file not found' error would seem more appropriate.
This arose from the discovery that when specifying a folder that a partial resides in, one must also specify the resource's folder as well, i.e. partial 'myresource/subfolder/apartial', not 'subfolder/apartial'.
Comments and changes to this ticket
-
Michael Klishin (antares) May 14th, 2008 @ 09:23 PM
- → Milestone changed from to 0.9.4
- → State changed from new to open
Doc says:
template<~to_s>: The path to the template, relative to the current controller or the template root. If the template contains a "/", Merb will search for it relative to the template root; otherwise, Merb will search for it relative to the current controller.
Could you submit a tiny patch for that?
-

Max Aller May 14th, 2008 @ 09:26 PM
I suppose the documentation DOES say that, but it still seems to be like Merb should only search relative to the template root if the template begins with a "/", not simply contains. I'll try to patch it.
-
Michael Klishin (antares) May 14th, 2008 @ 09:35 PM
Not sure about leading /. If I use render :partial => "people/_authorization_box" in action pack, it starts looking from app/views.
Could you check Rails behavior first?
-

Max Aller May 14th, 2008 @ 09:41 PM
I think you're right. Based on Rails' somewhat ambiguous API doc regarding shared partials, it looks like the current behavior is consistent with Rails'.
-
-

Max Aller May 14th, 2008 @ 11:02 PM
No, there should still be error reporting, even if I think the path to find the partial should be resolved differently ;)
To further clarify this bug, it only occurs when :with is specified. Here's the patch.
-
Michael Klishin (antares) May 14th, 2008 @ 11:42 PM
- → State changed from open to resolved
- → Assigned user changed from to Michael Klishin (antares)
Applied, thank you.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
