Euro sign in Select box

For hours I tried to get an Euro sign in my selectbox. Anyone have an
idea how I can do this.

I try:
<%= select(“prijs”, “prijs”,
['€12.500,‘12500’],
[‘€25.000’,‘25000’]], :selected =>
session[:zoek_prijs]) %>

But I don’t get an Euro-sign. The browser is displaying a ?-sign. I
tested it at several browsers. Any one an idea?

On 23 Aug 2007, at 09:32, Joost Saanen wrote:

<%= select(“prijs”, “prijs”,
['EURO 12.500,‘12500’],
[‘EURO 25.000’,‘25000’]], :selected =>
session[:zoek_prijs]) %>

But I don’t get an Euro-sign. The browser is displaying a ?-sign. I
tested it at several browsers. Any one an idea?

<%= select(“prijs”, “prijs”,
[‘€ 12.500’,‘12500’],
[‘€ 25.000’,‘25000’]], :selected =>
session[:zoek_prijs]) %>

Should output something similar to:
€ 100€
200€ 300€ 400</
select>

You could use the UTF-8 euro symbol itself: EURO
But you’ll get into trouble if your webserver doesn’t serve pages as
UTF-8 (i.e. it is sent in the headers). The € notation seems to
be more applicable (if the euro sign is present in the font you’re
using anyway).

Best regards

Peter De Berdt

Peter De Berdt wrote:

On 23 Aug 2007, at 09:32, Joost Saanen wrote:
<%= select(“prijs”, “prijs”,
[‘€ 12.500’,‘12500’],
[‘€ 25.000’,‘25000’]], :selected =>

When I use this, the following HTML is generate by Mongrel (also using
webrick)

&euro; 12.500

In my browser I see this in my selectbox:

€ 12.500
€ 25.000
etc.

On 23 Aug 2007, at 09:51, Joost Saanen wrote:

When I use this, the following HTML is generate by Mongrel (also using
webrick)

&euro; 12.500

In my browser I see this in my selectbox:

€ 12.500
€ 25.000

Apparently Rails escapes the text, could be the only solution is to
generate the select yourself instead of relying on the Rails helper:

<% @myprices.each do |
price| %><%= price.readable_value
-%><% end %>

Best regards

Peter De Berdt

Peter De Berdt wrote:

On 23 Aug 2007, at 09:51, Joost Saanen wrote:

When I use this, the following HTML is generate by Mongrel (also using
webrick)

&euro; 12.500

In my browser I see this in my selectbox:

€ 12.500
€ 25.000

Apparently Rails escapes the text, could be the only solution is to
generate the select yourself instead of relying on the Rails helper:

<% @myprices.each do |
price| %><%= price.readable_value
-%><% end %>

Best regards

Peter De Berdt

Hmmm… ok that is a solution, but what about the handy “:selected =>
session[:zoek_prijs])” -part? Should I do this with if statements?

geen voorkeur € 12.500 € 25.000 € 37.500 € 50.000 ... € 875.000

Is there not way to use the Rails helper?

problem solved!
The text file encoding of my IDE (aptana) was wrong, I changed it to
‘UTF-8’ and find and replace the bad euro signs with alt-0128 and now it
looks fine.
Thank for any help.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs