Smart RoR
2010-Mar-04 22:04 UTC
Static HTML in XML Builder or otherwise; With Dynamic Sectio
Best way to display HTML file as text or xml where some parts are dynamic? So we have a Static HTML file and some portions will be dynamically changed. The Idea is to render as text or xml simply. If we read this Template HTML file and Dynamically change it, where should we store this HTML file? If we create using XML Builder, would static HTML Part still be needed to be coded using Ruby? How can I put Static HTML part in XML Builder? -- 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-/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.
Smart RoR
2010-Mar-04 23:24 UTC
Re: Static HTML in XML Builder or otherwise; With Dynamic Sectio
Smart RoR wrote:> Best way to display HTML file as text or xml where some parts are > dynamic? > > So we have a Static HTML file and some portions will be dynamically > changed. > > The Idea is to render as text or xml simply. > > > If we read this Template HTML file and Dynamically change it, where > should we store this HTML file? > > If we create using XML Builder, would static HTML Part still be needed > to be coded using Ruby? How can I put Static HTML part in XML Builder?Anyone? I am thinking to just use XML Builder for HTML here, as static part is very less....... -- 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-/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.
Robert Walker
2010-Mar-07 05:50 UTC
Re: Static HTML in XML Builder or otherwise; With Dynamic Se
Smart RoR wrote:> Best way to display HTML file as text or xml where some parts are > dynamic?I really don''t understand what you''re trying to do there. How is what you are describing any different than standard ERB templates. They are static HTML with some dynamic parts.> So we have a Static HTML file and some portions will be dynamically > changed.Again isn''t that what ERB is?> The Idea is to render as text or xml simply.Both HTML and XML are just text anyway.> If we read this Template HTML file and Dynamically change it, where > should we store this HTML file?I''d store them in app/views where all the other HTML templates are stored. With the dynamic parts rendered with ERB.> If we create using XML Builder, would static HTML Part still be needed > to be coded using Ruby? How can I put Static HTML part in XML Builder?I can see no need for any of this. Just put the static HTML inside a view template and render the dynamic parts with ERB (or HAML if that''s what you might prefer). -- 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-/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.
Smart RoR
2010-Mar-07 07:01 UTC
Re: Static HTML in XML Builder or otherwise; With Dynamic Se
Robert Walker wrote:> Smart RoR wrote: >> Best way to display HTML file as text or xml where some parts are >> dynamic? > > I really don''t understand what you''re trying to do there. How is what > you are describing any different than standard ERB templates. They are > static HTML with some dynamic parts. > >> So we have a Static HTML file and some portions will be dynamically >> changed. > > Again isn''t that what ERB is? > >> The Idea is to render as text or xml simply. > > Both HTML and XML are just text anyway. > >> If we read this Template HTML file and Dynamically change it, where >> should we store this HTML file? > > I''d store them in app/views where all the other HTML templates are > stored. With the dynamic parts rendered with ERB. > >> If we create using XML Builder, would static HTML Part still be needed >> to be coded using Ruby? How can I put Static HTML part in XML Builder? > > I can see no need for any of this. Just put the static HTML inside a > view template and render the dynamic parts with ERB (or HAML if that''s > what you might prefer).Thanks. You are right. This was part of direct pure AJAX JS call. Still I also think it can still interpret as text whether we output from erb or xml builder. -- 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-/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.