Reputation: 4728
I am still learning Ruby and was using this code on my RoR app:
<title><%= content_for?(:title) ? yield(:title):"" %> - Mysite</title>
I want to add another static word, " - "
or " | "
, in yield(:title)
. How to do it?
Upvotes: 1
Views: 68
Reputation: 12818
<title><%= content_for?(:title) ? "#{yield(:title)} -" : "" %> - Mysite</title>
Upvotes: 2