Hi, i have a text field in html format "It is a <span>sunny </span> day. <br> Bye" When i put in the rhtml <%= news.text_field %> I get printed the text with the tags inside.... is there a to_html or soemthing like that? thanks Christian --~--~---------~--~----~------------~-------~--~----~ 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/20/07, cfingerh <cfingerh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, i have a text field in html format "It is a <span>sunny </span> > day. <br> Bye" > When i put in the rhtml > <%= news.text_field %> > I get printed the text with the tags inside.... > is there a to_html or soemthing like that? > > thanks > > ChristianYou may need to provide some more information about what your trying to do. An HTML Text field, or textarea will not render as html. They only contain text. Perhaps something like tinyMCE or similar javascript powered rich editor is what your after. Daniel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I will try to explain it better... It is not for editing or creating a text. I already have the text in my table-database I have <% for new in @news %> Title:<h1><%= new.title.to_s %></h1> <br> <%= new.title.text %> <br> <%end> And the text field has html tags inside (divs and spans) The result is that the text printed is with the tags.For example Title: New Member in the Society The society wants to <span class="bold">announce</span> that: <br> Mr etc, etc Title: New Member in the Society The society wants to <span class="bold">announce</span> that: <br> Mr etc, etc --~--~---------~--~----~------------~-------~--~----~ 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/20/07, cfingerh <cfingerh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I will try to explain it better... > It is not for editing or creating a text. I already have the text in > my table-database > > I have > <% for new in @news %> > Title:<h1><%= new.title.to_s %></h1> > <br> > <%= new.title.text %> > <br> > <%end> > > And the text field has html tags inside (divs and spans) > The result is that the text printed is with the tags.For example > > Title: New Member in the Society > The society wants to <span class="bold">announce</span> > that: <br> Mr etc, etc > Title: New Member in the Society > The society wants to <span class="bold">announce</span> > that: <br> Mr etc, etcWhere does the text method come from in this line? <%= new.title.text %> It seems that title is an attribute of the AR model, but there is no text method that I know of on String. What kind of object is it? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sorry.... <%= new.text %> text is the name of the field thanks --~--~---------~--~----~------------~-------~--~----~ 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/20/07, cfingerh <cfingerh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > sorry.... > > <%= new.text %> > > text is the name of the field > > thanksCool. That makes more sense to me. There is nothing imediate that jumps to mind except that at some point it seems that the tags are being escaped. If you select these directly from the database, or using the console. Is the markup like The society wants to <span class="bold">announce</span> that: <br> Mr etc, etc Or is the tags escaped? Like The society wants to <span class="bold"&gr;announce</span> that: <br> Mr etc, etc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
In the screen I get it The society wants to <span class="bold">announce</span> that: <br> Mr etc, etc The society wants to <span class="bold"&gr;announce</span> that: <br> Mr etc, etc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I get it printed like The society wants to <span class="bold">announce</span> that: <br> Mr etc, etc but in the Page Source it is tags escaped .... The society wants to <span class="bold"&gr;announce</span> that: <br> Mr etc, etc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I found the problem. I had <%=h new.text %> not <%= new.text %> Anyway thank you very much Daniel --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---