Maxem
Maxem

Reputation: 2684

haml / rails: yield title with german umlauts

I would like to do something like this in my application layout:

%title= "#{yield(:sub_title)} - Page Name" 

and in a real view

- content_for :sub_title do
  Übersicht # I tried Übersicht, != "Übersicht" and a bunch of other methods

what happens is, I either get the black pound with the question mark in it -> wrong encoding or the raw string (&UumI;bersicht).

Does anyone know a way how to get this to work? Another requirement is that I'd like to show user generated content in the title and this content may or may not have umlauts in it.

Used versions: Haml 3.0.11, Rails 3 beta4 and currently for development JRuby 1.5

Upvotes: 3

Views: 623

Answers (1)

Brian Deterling
Brian Deterling

Reputation: 13734

Do you have a line like the following at the top of your action? With that, the Ü works for me in the title.

content_type 'text/html', :charset => 'utf-8'

Upvotes: 2

Related Questions