Hello, I would like to be able to pass html code into a text_area in a form so that it is displayed as executed code i.e. i want to be able to apply different fonts to different words in the text_area. Is this a possibility? At the moment i am using text_area_tag and the html that i pass in just seems to be displayed as a string.. which makes sense - however i need the html that i pass in to be executed and displayed properly.. Am i using the correct container to perform this task or is there a better one available? The reason that i am doing this is that i would like the user to be able to type Ruby code into a form and i would use javascript to make a call to a function that parses the input - using the syntax plugin (generates html from ruby code) - and then display this ''syntax highlighted'' code in the browser (in the form).. Any ideas would be much appreciated -- 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 -~----------~----~----~----~------~----~------~--~---
> I would like to be able to pass html code into a text_area in a form so > that it is displayed as executed code i.e. i want to be able to apply > different fonts to different words in the text_area. Is this a > possibility?Textareas are, by definition, just plain text. So i don''t think this is possible using them as they will only ever take in a string and display it as a string.> Am i using the correct container to perform this task or is there a > better one available?No, is the short answer. I am not aware of a container that will allow you to display editable html code. However i could be proved wrong! - j -- 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 -~----------~----~----~----~------~----~------~--~---
you mean something like this? http://codepress.fermads.net/ On 2/14/07, James Smith <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > > I would like to be able to pass html code into a text_area in a form so > > that it is displayed as executed code i.e. i want to be able to apply > > different fonts to different words in the text_area. Is this a > > possibility? > > Textareas are, by definition, just plain text. So i don''t think this is > possible using them as they will only ever take in a string and display > it as a string. > > > Am i using the correct container to perform this task or is there a > > better one available? > > No, is the short answer. I am not aware of a container that will allow > you to display editable html code. However i could be proved wrong! > > - j > > -- > 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 -~----------~----~----~----~------~----~------~--~---
of course, i forgot to mention it''s backend is done in php, but the point is, it can be done. On 2/14/07, Chris Hall <christopher.k.hall-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> you mean something like this? > > http://codepress.fermads.net/ > > On 2/14/07, James Smith <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > I would like to be able to pass html code into a text_area in a form so > > > that it is displayed as executed code i.e. i want to be able to apply > > > different fonts to different words in the text_area. Is this a > > > possibility? > > > > Textareas are, by definition, just plain text. So i don''t think this is > > possible using them as they will only ever take in a string and display > > it as a string. > > > > > Am i using the correct container to perform this task or is there a > > > better one available? > > > > No, is the short answer. I am not aware of a container that will allow > > you to display editable html code. However i could be proved wrong! > > > > - j > > > > -- > > 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 -~----------~----~----~----~------~----~------~--~---
Chris Hall wrote:> you mean something like this? > > http://codepress.fermads.net/Yes, but would would you be able to integrate that with rails, it seems to only load from a file or am i missing something - is it possible to save and load from a database? -- 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 -~----------~----~----~----~------~----~------~--~---