>> Out of interest, what's your problem with the above code? > > its crutch, for incomprehensible thing > > Sorry, I don't understand - could you rephrase...
U should not insert if request.xhr? u can create view, with build js ( show.js.erb) and in its view call render, but with js escape > 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. 10LOC, yep its for simple results, such twitter post, github notify, or something else in my project, we use haml, we can simplify use jshaml tools, for simplify create dom elements in js > This shows how we're obviously working on different projects :-) I would say, as far as we are working on projects with a completely different level of thoughtfulness interface ;-) > I'd take, I'd go with a partial first and optimise to JSON/JS rendering if > required later. in phase of prototyping, i thing we can completely remove all ajax, calls if we can. Ivan Nastyukhin [email protected] On Jun 3, 2010, at 6:36 PM, Andy Jeffries wrote: >> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

