hello ,, i have following content in my string .. str="<p>hiii</p> <p> </p> <p>rahul mehta</p>"; i want to show first 150 character in a single line how i cant show it pleas help.. thanks rahul -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Paragraphs (<p>) are printed on new lines, that''s how HTML works. If you dont want that, dont use paragraphs. On Apr 28, 10:55 am, Rahul Mehta <rahul23134...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hello ,, > > i have following content in my string .. > str="<p>hiii</p> > <p> </p> > <p>rahul mehta</p>"; > > i want to show first 150 character in a single line how i cant show it > > pleas help.. > > thanks > > rahul > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
hii actually m using tinymce editor so <p> tag is automatically created so i cant remove them, is there is any other way. thanks On Apr 28, 2:06 pm, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Paragraphs (<p>) are printed on new lines, that''s how HTML works. > If you dont want that, dont use paragraphs. > > On Apr 28, 10:55 am, Rahul Mehta <rahul23134...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > hello ,, > > > i have following content in my string .. > > str="<p>hiii</p> > > <p> </p> > > <p>rahul mehta</p>"; > > > i want to show first 150 character in a single line how i cant show it > > > pleas help.. > > > thanks > > > rahul > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
There exists a ruby library for HTML sanitizing, which would solve your issue: http://wonko.com/post/sanitize On Apr 28, 11:12 am, Rahul Mehta <rahul23134...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hii > > actually m using tinymce editor so <p> tag is automatically created so > i cant remove them, is there is any other way. > > thanks > > On Apr 28, 2:06 pm, Sharagoz <shara...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Paragraphs (<p>) are printed on new lines, that''s how HTML works. > > If you dont want that, dont use paragraphs. > > > On Apr 28, 10:55 am, Rahul Mehta <rahul23134...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > hello ,, > > > > i have following content in my string .. > > > str="<p>hiii</p> > > > <p> </p> > > > <p>rahul mehta</p>"; > > > > i want to show first 150 character in a single line how i cant show it > > > > pleas help.. > > > > thanks > > > > rahul > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.