> Out of interest, what's your problem with the above code? its crutch, for incomprehensible thing
> 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, this is my opinion of course, i will not be try to convince u) Ivan Nastyukhin dieinz...@me.com On Jun 3, 2010, at 6:23 PM, Andy Jeffries wrote: > On 3 June 2010 15:17, Ivan Nastyukhin <dieinz...@me.com> wrote: >> if request.xhr? >> render :partial => "whatever" >> end > > if developers, from my team, write this, i curse too much for such) > > If a developer from my team makes a judgement/technical direction based on > incomplete facts I'd curse too much too :-) > > Out of interest, what's your problem with the above code? > > yep, if u will be cache the render time, will be good. but data with u send, > will be huge. > Insert big html into dom, is slower then build its in js. > > That's the important fact - we don't know how much data/html will be > returned. I'm assuming it will be relatively small (the OP said mobile > device), you're assuming it will be huge. > > Neither of us know, so I'd prefer to go with the simpler solution (that keeps > display logic/markup generation in one place) and optimise to a JSON/DOM > insertion later *IF* it's found to be required. Premature optimisation is > the root of all evil... > > 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. -- 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.