-
Notifications
You must be signed in to change notification settings - Fork 72
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
Make use content_for method #33
Conversation
Could you explain why you think |
Simple instance variable doesn't have informations enough, it is hard to know that where / how used to. that would be complicated. The |
@@ -59,7 +59,7 @@ html | |||
|
|||
aside.right-side | |||
section.content-header | |||
h1= raw(@content_title || @title) | |||
h1= raw yield(:content_title) || yield(:title) |
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.
yield(:undefined_symbol)
returns ""
(empty string).
So yield(:content_title) || yield(:title)
returns always yield(:content_title)
value.
Do you want yield(:content_title).presence || yield(:title)
here?
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.
Thank you!
fixed
@@ -20,6 +20,9 @@ | |||
expect(page).to have_selector('#definitions_list table tbody tr', count: 1) | |||
|
|||
expect(page).to have_content('There are no working jobs.') | |||
expect(page).to have_title('Dashboard « Kuroko 2') | |||
expect(page).to have_selector('i.fa.fa-dashboard', text: '') | |||
expect(page).to have_content(' Dashboard') |
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.
The Dashboard
may be displayed in other places.
How about using have_selector('h1', text: /Dashboard/)
?
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.
Sounds good! thanks!
fixed
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.
LGTM
I'd prefer to use
content_for
tag when I want to set title tag from view partials.This pull-request fixes to set title by using
content_for
andyield
clause which are view helper methods.