1
votes

I'm very new to rails.

I have an existing MS SQL DB and build the rails-app on it. I just scaffolded all required stuff from the existing tables.

But, I have an Umlaut in my index.html.erb source code.

<td><%= wohnung.Grösse %></td>

But this raises an 500 Internal Server Error.

The development.log doesn't helps me...:

Started GET "/wohnungs" for 127.0.0.1 at 2012-01-05 13:52:24 +0100
Processing by WohnungsController#index as HTML
[1m[36mWohnung Load (0.0ms)[0m  [1mEXEC sp_executesql N'SELECT [Wohnung].* FROM [Wohnung]'[0m
Rendered wohnungs/index.html.erb within layouts/application (15.6ms)
Completed 500 Internal Server Error in 62ms

If I remove this line, it works. But every other umlaut in texts is represented by a '�' ...

What I did:

  • Added '#coding: utf-8' on top of the wohnung_controller
  • Added 'encoding: utf8' to the database.yml,
  • Added 'config.encoding = "utf-8"' to the application.rb,
  • Added meta http-equiv="Content-Type" content="text/html; charset=utf-8" to the application.html.erb-file.

I've no idea what I could do next...Please help :)

Greetings, Beasty

1
Not sure if its a typo but, '#coding: utf-8' on top of the wohnung_controller must read '#encoding: utf-8'Anand Shah
Yep, it was an typo... The error occurs in the the *.html.erb files actually. But I added meta-tags for the unicode etc. But nothing changes, I still got the problem...Beastcraft

1 Answers

1
votes

Why don't you use a less problematic circumscription like wohnung.groesse ? You probably only have to rename a database column. It is not recommendable to use special characters in a function or database column name.