Hi all, I sent a message earlier, so forgive me if you have already read this (I got some cryptic message in German about how my e-mail was not read?). Anyway, I was just wondering if there was any way to format the html that is output using <%= @content_for_layout %> I want to use something like the PHP Beautify. I guess I could write my own, but I was hoping that Rails already had something built in. Thanks to all. Have a great day. -- Topher Fangio fangiotophia@gmail.com http://www.fangiotophia.com Website Specialist Fangiotophia Designs (325) 660-7141
The "content_for_layout" declaration simply renders a template within the layout... so... you''d probably want to just format the template in the first place ? Otherwise, assuming the @content_for_layout variable actually contains all the HTML (which I haven''t bothered to look at), you could run this variable through a method of your choice prior to rendering. On 2/14/06, Toph <fangiotophia@gmail.com> wrote:> > Hi all, I sent a message earlier, so forgive me if you have already > read this (I got some cryptic message in German about how my > e-mail was not read?). Anyway, I was just wondering if there was > any way to format the html that is output using > > <%= @content_for_layout %> > > I want to use something like the PHP Beautify. I guess I could > write my own, but I was hoping that Rails already had something > built in. Thanks to all. Have a great day. > > -- > Topher Fangio > fangiotophia@gmail.com > http://www.fangiotophia.com > > Website Specialist > Fangiotophia Designs > (325) 660-7141 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060215/81177304/attachment.html
Yes, I was hoping that Rails already had a method to make the html pretty without me having to write one. Or a library, or something. If not, all I really want is tabs and I wrote it in PHP, so I guess I could just copy the algorithm. Thanks for the repsonse =) On 2/14/06, Dylan Stamat <dylans@gmail.com> wrote:> The "content_for_layout" declaration simply renders a template within the > layout... so... you''d probably want to just format the template in the first > place ? > Otherwise, assuming the @content_for_layout variable actually contains all > the HTML (which I haven''t bothered to look at), you could run this variable > through a method of your choice prior to rendering. > > > > > On 2/14/06, Toph <fangiotophia@gmail.com> wrote: > > > > Hi all, I sent a message earlier, so forgive me if you have already > > read this (I got some cryptic message in German about how my > > e-mail was not read?). Anyway, I was just wondering if there was > > any way to format the html that is output using > > > > <%= @content_for_layout %> > > > > I want to use something like the PHP Beautify. I guess I could > > write my own, but I was hoping that Rails already had something > > built in. Thanks to all. Have a great day. > > > > -- > > Topher Fangio > > fangiotophia@gmail.com > > http://www.fangiotophia.com > > > > Website Specialist > > Fangiotophia Designs > > (325) 660-7141 > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Topher Fangio fangiotophia@gmail.com http://www.fangiotophia.com Website Specialist Fangiotophia Designs (325) 660-7141
There is a ruby interface to the tidy library. Sop you can use that to tidy up your html before output. Cheers- -Ezra On Feb 14, 2006, at 6:37 PM, Toph wrote:> Yes, I was hoping that Rails already had a method to make the html > pretty > without me having to write one. Or a library, or something. If not, > all I really > want is tabs and I wrote it in PHP, so I guess I could just copy > the algorithm. > Thanks for the repsonse =) > > On 2/14/06, Dylan Stamat <dylans@gmail.com> wrote: >> The "content_for_layout" declaration simply renders a template >> within the >> layout... so... you''d probably want to just format the template in >> the first >> place ? >> Otherwise, assuming the @content_for_layout variable actually >> contains all >> the HTML (which I haven''t bothered to look at), you could run this >> variable >> through a method of your choice prior to rendering. >> >> >> >> >> On 2/14/06, Toph <fangiotophia@gmail.com> wrote: >>> >>> Hi all, I sent a message earlier, so forgive me if you have already >>> read this (I got some cryptic message in German about how my >>> e-mail was not read?). Anyway, I was just wondering if there was >>> any way to format the html that is output using >>> >>> <%= @content_for_layout %> >>> >>> I want to use something like the PHP Beautify. I guess I could >>> write my own, but I was hoping that Rails already had something >>> built in. Thanks to all. Have a great day. >>> >>> -- >>> Topher Fangio >>> fangiotophia@gmail.com >>> http://www.fangiotophia.com >>> >>> Website Specialist >>> Fangiotophia Designs >>> (325) 660-7141 >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> > > > -- > > Topher Fangio > fangiotophia@gmail.com > http://www.fangiotophia.com > > Website Specialist > Fangiotophia Designs > (325) 660-7141 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz WebMaster Yakima Herald-Republic Newspaper ezra@yakima-herald.com 509-577-7732
Toph wrote:> Hi all, I sent a message earlier, so forgive me if you have already > read this (I got some cryptic message in German about how my > e-mail was not read?). Anyway, I was just wondering if there was > any way to format the html that is output using > > <%= @content_for_layout %> > > I want to use something like the PHP Beautify. I guess I could > write my own, but I was hoping that Rails already had something > built in. Thanks to all. Have a great day. >I sent this earlier, but it sounds like you didn''t see any responses, so: There is a ruby interface to tidy: http://rubyforge.org/projects/tidy/ Not sure what you would need to do to hook it into a rails app. You could also rewrite your rhtml files as rxml... at least I would think that building the page as an xml tree and then writing it out would create a nice neat source output. b
If someone is still interested on this topic: http://www.cosinux.org/blogs/dam/pages/rails-tidy On 2/15/06, Toph <fangiotophia@gmail.com> wrote:> Hi all, I sent a message earlier, so forgive me if you have already > read this (I got some cryptic message in German about how my > e-mail was not read?). Anyway, I was just wondering if there was > any way to format the html that is output using > > <%= @content_for_layout %> > > I want to use something like the PHP Beautify. I guess I could > write my own, but I was hoping that Rails already had something > built in. Thanks to all. Have a great day. > > -- > Topher Fangio > fangiotophia@gmail.com > http://www.fangiotophia.com > > Website Specialist > Fangiotophia Designs > (325) 660-7141 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >