-
Notifications
You must be signed in to change notification settings - Fork 8
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
#4 partial in subfolder #5
base: master
Are you sure you want to change the base?
Conversation
@@ -16,8 +16,14 @@ def layouts_path | |||
"#{views_path}/layouts" | |||
end | |||
|
|||
def partial_path(template) | |||
parts = template.split('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
@houndci: everywhere @patriciomacadden use single quote. This should fix partial bug in subfolder for render (tilt) and mote. |
I added new tests in this pull request, this fix situation when you want load partial in subfolder, for example, when you pass partial 'namespace/partial' now it load _namespace/partial template, becouse you prepend _. My fix finding last element in path and add _ to that element. So load namespace/_partial. Is it ok, or do you prefer make more test(s)? |
Hi @wafcio, here are my thoughts about this PR:
If we can move the logic of |
ok I will try it |
@@ -9,6 +9,9 @@ def default_layout | |||
end | |||
|
|||
def find_template(template) | |||
if template.to_s[0] == '_' && template.match('/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
@patriciomacadden it should look better, I mean this is in one method, but find_template after added partial fix look to much complexity for me. |
No description provided.