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", [''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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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: <select><option selected="selected">€ 100</option><option>€ 200</option><option>€ 300</option><option>€ 400</option></ 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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) <option value="12500">&euro; 12.500</option> In my browser I see this in my selectbox: € 12.500 € 25.000 etc. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 23 Aug 2007, at 09:51, Joost Saanen wrote:> When I use this, the following HTML is generate by Mongrel (also using > webrick) > > <option value="12500">&euro; 12.500</option> > > In my browser I see this in my selectbox: > > € 12.500 > € 25.000Apparently Rails escapes the text, could be the only solution is to generate the select yourself instead of relying on the Rails helper: <select id="prijs_prijs" name="prijs[prijs]"><% @myprices.each do | price| %><option value="<%= price.value -%>"><%= price.readable_value -%></option><% end %></select> Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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) >> >> <option value="12500">&euro; 12.500</option> >> >> 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: > > <select id="prijs_prijs" name="prijs[prijs]"><% @myprices.each do | > price| %><option value="<%= price.value -%>"><%= price.readable_value > -%></option><% end %></select> > > > Best regards > > Peter De BerdtHmmm.. ok that is a solution, but what about the handy ":selected => session[:zoek_prijs])" -part? Should I do this with if statements? <select id="prijs_prijs" name="prijs[prijs]"> <option value="">geen voorkeur</option> <option value="12500">€ 12.500</option> <option value="25000">€ 25.000</option> <option value="37500">€ 37.500</option> <option value="50000">€ 50.000</option> ... <option value="875000">€ 875.000</option> </select> Is there not way to use the Rails helper? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---