> > Out of interest, what's your problem with the above code? > > its crutch, for incomprehensible thing >
Sorry, I don't understand - could you rephrase... > Premature optimisation is the root of all evil... > > yep, but i'm thinking, that write 1-10 LOC in js, witch will be build > partial for each json element, its not optimisation, its "by default" use > case, > The problem is we don't know how complex his logic is that converts the data structure to HTML. I think you have a fairly simple display if it's only 10 LOC in JS to build it. This shows how we're obviously working on different projects :-) In my world the logic to display data is large/complicated but the data displayed (per page) is relatively small. > this is my opinion > of course, i will not be try to convince u) > I'm happy for you to convince me, I'm also happy to debate it (debates help everyone clarify their own thoughts/opinions). And I don't necessarily disagree with you that your solution is faster (for the client) and may be better (if a large data set and simple display logic), but it's just that it's not the first step I'd take, I'd go with a partial first and optimise to JSON/JS rendering if required later. Cheers, Andy -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.