hi i''m pretty new to rails, so excuse me. Is there a way to programmatically build the DOM tree in Rails? This seems a pretty fundamental feature to have .. eg, generating the view for a calendar. There''s a clear pattern of table/css elements, half-in-step with a bunch of data that''s going to appear on the calendar. It would be clean to have two separate loops for these in code, one for the html stuff, one for the content. -- or is there another way to keep these concerns separate? or perhaps there is a clever (not ridic) design solution? thanks, Darren --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
darren wrote:> hi > > i''m pretty new to rails, so excuse me. > > Is there a way to programmatically build the DOM tree in Rails? This > seems a pretty fundamental feature to have .. > > eg, generating the view for a calendar. There''s a clear pattern of > table/css elements, half-in-step with a bunch of data that''s going to > appear on the calendar. > > It would be clean to have two separate loops for these in code, one > for the html stuff, one for the content. -- or is there another way to > keep these concerns separate? > > or perhaps there is a clever (not ridic) design solution?The usual way is the script.aculo.us builder module: http://github.com/madrobby/scriptaculous/wikis/builder though sometimes a good way is to render a display:none HTML template in the page, make clones of that, and loop through replacing dummy text nodes with real data. -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.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 -~----------~----~----~----~------~----~------~--~---
Thanks for the feedback Mark. I don''t think scriptaculous'' Builder is what I''m after as it''s JavaScript, but it seems the Rails/Rubyforge Builder is the server- side equivalent that I''m after. Cheers, Darren On Sep 3, 8:00 am, Mark Reginald James <m...-ejQy8aU/RJumpXlQD71PVDSf8X3wrgjD@public.gmane.org> wrote:> darren wrote: > > hi > > > i''m pretty new to rails, so excuse me. > > > Is there a way to programmatically build the DOM tree in Rails? This > > seems a pretty fundamental feature to have .. > > > eg, generating the view for a calendar. There''s a clear pattern of > > table/css elements, half-in-step with a bunch of data that''s going to > > appear on the calendar. > > > It would be clean to have two separate loops for these in code, one > > for the html stuff, one for the content. -- or is there another way to > > keep these concerns separate? > > > or perhaps there is a clever (not ridic) design solution? > > The usual way is the script.aculo.us builder module: > > http://github.com/madrobby/scriptaculous/wikis/builder > > though sometimes a good way is to render a display:none > HTML template in the page, make clones of that, and loop > through replacing dummy text nodes with real data. > > -- > Rails Wheels - Find Plugins, List & Sell Plugins -http://railswheels.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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
perhaps they''re actually related .. i didn''t actually think to check :-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---