you can never use a print or puts method in an ERB template (or
anywhere else in Rails for that matter).
To achieve what you''re asking, you could, eg, interpolate the
page_title variable like this:
<title>softrockcookie<%= " :: #{page_title}" unless
page_title ="softrockcookie" %></title>
sebastian
> <title>softrockcookie <%= page_title unless page_title =>
"softrockcookie" %></title>
On Mar 28, 2006, at 4:25 PM, Sebastian Spanner wrote:
> Hi!
>
> I am new to Rails and wanted to know how I can print an easy
> string-line.
> I wanted to generate a dynamic title for my blog articles made with
> "typo":
>
> The first part of the html-title stays the same:
>
> <title>softrockcookie</title>
>
> if it is not the mainpage ("softrockcookie") it shall add the
> page_title, so:
>
> <title>softrockcookie <%= page_title unless page_title =>
"softrockcookie" %></title>
>
> it worked so far...
>
> and now, to seperate the two parts i wanted a double-doublepoint
> ("::"),
> but couldn''t implement it yet. however, I tried it that way and
got an
> error:
>
> <title>softrockcookie
> <%= unless page_title == "softrockcookie"
> print " :: "
> page_title
> end
> %>
>
> no clue how to do it the right way... could you please help a poor
> noob?
> thank you!
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>