Chris
2006-Apr-04 10:17 UTC
[Rails] Anyone noticed slow rendering performance with formhelpers?
It seems like the form helpers, such as "link_to" and "check_box" really slows down rendering when you have hundreds of rows. Has anyone else noticed this?? Is there a way to go around it apart from typing the raw html? -- Posted via http://www.ruby-forum.com/.
Jeroen Houben
2006-Apr-04 10:24 UTC
[Rails] Anyone noticed slow rendering performance with formhelpers?
Chris wrote:> It seems like the form helpers, such as "link_to" and "check_box" really > slows down rendering when you have hundreds of rows. > > Has anyone else noticed this?? Is there a way to go around it apart > from typing the raw html?I doubt it. Use pagination or caching I would say. Jeroen
I am writing an app that tracks online stories (and this is my first rails app). The main Story table has an id, title and description field (plus others). The stories have prequels and sequels. What is the best way of storing the sequel and prequel data as it references the one main Story table. I was thinking about putting in a parent_id column that would look like this : id title parent_id ------------------------------------------------------------- 1 A Phantom Menace NULL 2 Attack Of The Clones 1 3 Revenge Of The Sith 2 4 A New Hope 3 5 Empire Srikes Back 4 6 Return Of The Jedi 5 7 Terminator NULL 8 Terminator 2 7 9 Terminator 3 8 etc etc 1/ Is this the best way to store this sort of data? Note : My UI would consist of a list and the user would drag the stories into the order (top to bottom using ajax magic) and then the data would be saved to the DB. Once in the DB how would I go about extracting it out (say if I was wanting to edit A New Hope in the example above). I would want the model to produce the list of stories in order if I was editing item 4 for example. Any suggestions or pointers on tackling this problem. Thanks, Rob
sounds like acts_as_tree On 4/4/06, Robert Zolkos <robert@zolkos.com> wrote:> > I am writing an app that tracks online stories (and this is my first > rails app). > > The main Story table has an id, title and description field (plus > others). The stories have prequels and sequels. What is the best > way of storing the sequel and prequel data as it references the one > main Story table. > > I was thinking about putting in a parent_id column that would look > like this : > > id title parent_id > ------------------------------------------------------------- > 1 A Phantom Menace NULL > 2 Attack Of The Clones 1 > 3 Revenge Of The Sith 2 > 4 A New Hope 3 > 5 Empire Srikes Back 4 > 6 Return Of The Jedi 5 > 7 Terminator NULL > 8 Terminator 2 7 > 9 Terminator 3 8 > etc > etc > > > > 1/ Is this the best way to store this sort of data? > > Note : My UI would consist of a list and the user would drag the > stories into the order (top to bottom using ajax magic) and then the > data would be saved to the DB. > > Once in the DB how would I go about extracting it out (say if I was > wanting to edit A New Hope in the example above). I would want the > model to produce the list of stories in order if I was editing item 4 > for example. > > Any suggestions or pointers on tackling this problem. > > Thanks, > > Rob > _______________________________________________ > 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/20060404/ec95398e/attachment.html
certainly does. am learning about it now. thanks On 04/04/2006, at 10:11 PM, Chris Hall wrote:> sounds like acts_as_tree > > On 4/4/06, Robert Zolkos <robert@zolkos.com> wrote: > I am writing an app that tracks online stories (and this is my first > rails app). > > The main Story table has an id, title and description field (plus > others). The stories have prequels and sequels. What is the best > way of storing the sequel and prequel data as it references the one > main Story table. > > I was thinking about putting in a parent_id column that would look > like this : > > id title > parent_id > ------------------------------------------------------------- > 1 A Phantom Menace NULL > 2 Attack Of The Clones 1 > 3 Revenge Of The Sith 2 > 4 A New Hope 3 > 5 Empire Srikes Back 4 > 6 Return Of The Jedi 5 > 7 Terminator NULL > 8 Terminator 2 7 > 9 Terminator 3 8 > etc > etc > > > > 1/ Is this the best way to store this sort of data? > > Note : My UI would consist of a list and the user would drag the > stories into the order (top to bottom using ajax magic) and then the > data would be saved to the DB. > > Once in the DB how would I go about extracting it out (say if I was > wanting to edit A New Hope in the example above). I would want the > model to produce the list of stories in order if I was editing item 4 > for example. > > Any suggestions or pointers on tackling this problem. > > Thanks, > > Rob > _______________________________________________ > 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-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/8473c42c/attachment.html