Hi, under webrick the character, £, displays fine. Under apache it has some problems. The £ displays fine on my administrator page, using the default generated code: <% for column in Product.content_columns %> <p> <b><%= column.human_name %>:</b> <%=h @product.send(column.name) %> </p> <% end %> but when i construct my own view, and use: <p><%= @product.price_prefix %><%= sprintf("%0.2f",@product.price) %></p> the £ displays as ablack diamond and white question mark. Whats that all about? -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> > the £ displays as ablack diamond and white question mark. > > Whats that all about? >The pound sign should be the character entity: £ Various page encodings will probably mess with it in different ways otherwise. Regards, Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks andrew, unfortunatly this is user entered content, i feel its not reasonable to ask them to enter £. But i dont understand how it can be displayed correctly, and incorrectly on the same site, rails is doing something different when it renders these views. -- 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 -~----------~----~----~----~------~----~------~--~---
Try put an ''H'' when you output ruby code, eg: <p> <%=h @product.price_prefix %> <%=h sprintf("%0.2f",@product.price)%> </p> <%=h CONTENT %> will escape things for you. Jorge On 3/1/07, Jon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Thanks andrew, unfortunatly this is user entered content, i feel its not > reasonable to ask them to enter £. > > But i dont understand how it can be displayed correctly, and incorrectly > on the same site, rails is doing something different when it renders > these views. > > -- > Posted via http://www.ruby-forum.com/. > > > >-- ------------------------------- Jorge Sousa --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Jorge, unfortunately it had no effect. -- 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 -~----------~----~----~----~------~----~------~--~---