This is probably super easy to solve, but I can't quite get it right.
I want the copyright years in the footer to be dynamically generated. So, I have come up with some Ruby code in the template file that does almost all of that and it works. The problem is outputting the contents of the variable into the generated pages.
My code looks like this:
[...]
<div id="footer">
<%
baseyear = 2009;
year = Time.now.year;
copyright = baseyear.to_s;
if year > baseyear
copyright += " – #{year}";
end
%>
<p>© <%= copystr %> My Company</p>
</div>
[...]
If I use <%= copystr %> in an attempt to output the contents of "copystr" into the page, I get "undefined local variable or method `copystr'".
If, instead, I use <% print copystr %>, it does recognize the variable, but prints it on stdout once while generating the pages and doesn't include it in the page output itself.
So, how do I get the contents of "copystr" included in all my pages?
Thanks,
-Markus
|