Hi all, I''ve been searching for hours trying to find a way to display the euro symbol using the select method. My code is as follows: addresses = @cart.company.delivery_addresses.map {|a| [a.description, a.id]} addresses << ["Other address € 5,00",0] select "delivery_address", "address_id", addresses The problem is that rails makes the input html save, does anyone have an idea how to accomplice this? --~--~---------~--~----~------------~-------~--~----~ 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 6/14/07, Cow <r.kalff-0Pd/PUahhFZWk0Htik3J/w@public.gmane.org> wrote:> > Hi all, > > I''ve been searching for hours trying to find a way to display the euro > symbol using the select method. My code is as follows: > > addresses = @cart.company.delivery_addresses.map {|a| [a.description, > a.id]} > addresses << ["Other address € 5,00",0] > select "delivery_address", "address_id", addresses > > The problem is that rails makes the input html save, does anyone have > an idea how to accomplice this?So you need to include the character directly. Assuming your output encoding is UTF-8 (default in latest Rails), you can do something like: euro = [8364].pack(''U'') addresses << ["Other address #{euro} 5,00",0] I don''t know if Ruby accepts UTF-8 source code, but if it does, you could just insert the character directly (if your editor can do that). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Cool, works great (both the direct and indirect method). Thanks for the quick reply (and the answer). On Jun 14, 4:21 pm, "Bob Showalter" <showa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 6/14/07, Cow <r.ka...-0Pd/PUahhFZWk0Htik3J/w@public.gmane.org> wrote: > > > > > Hi all, > > > I''ve been searching for hours trying to find a way to display the euro > > symbol using the select method. My code is as follows: > > > addresses = @cart.company.delivery_addresses.map {|a| [a.description, > > a.id]} > > addresses << ["Other address € 5,00",0] > > select "delivery_address", "address_id", addresses > > > The problem is that rails makes the input html save, does anyone have > > an idea how to accomplice this? > > So you need to include the character directly. Assuming your output > encoding is UTF-8 (default in latest Rails), you can do something > like: > > euro = [8364].pack(''U'') > addresses << ["Other address #{euro} 5,00",0] > > I don''t know if Ruby accepts UTF-8 source code, but if it does, you > could just insert the character directly (if your editor can do that).--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---