TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How Rails Developers do Ajax in 2011

118 pointsby chadfowlerover 14 years ago

6 comments

glasnerover 14 years ago
I wrote a small wrapper on top of backbone and Backbone.Rails.js [1]. The combo replaced a very bulky internal framework, and I would never go back.<p>[1] <a href="https://gist.github.com/719080" rel="nofollow">https://gist.github.com/719080</a>
fphilipeover 14 years ago
Before I started developing Rails I always used JSON + client side templates which were constructed in pure jQuery and really tedious.<p>Then, with Rails, I asked myself, why would I want to have the template somewhere in the middle of a JS file where it isn't even recognizable as an HTML template at first sight? Why not have it, like all the other views, in one convenient place? Furthermore, often you have a partial you render on the server side and with some AJAX you send more entities of this partial to the client. Having this partial twice is really tedious if you wan't to tweak the HTML.
bhermsover 14 years ago
Could anyone share some good tutorials or guides on getting started with (preferably jQuery) AJAX and Rails 3?<p>I'm doing a little here and there in a current web app, but I could absolutely use some tips, pointers, and direction on better ways.
评论 #2195986 未加载
评论 #2195904 未加载
zzzmarcusover 14 years ago
Is anyone using pure.js? That's been one on my radar since they use pure HTML templates with JSON models. I don't think it does data binding to update the template automatically after the first render if the model changes, but apart from that, it seems preferable to using custom templates like jQuery or Mustache etc.<p><a href="http://beebole.com/pure/" rel="nofollow">http://beebole.com/pure/</a><p>That having been said, I haven't started using it yet. I'm open to other viewpoints.
评论 #2196928 未加载
minalecsover 14 years ago
I like to use a combination of these. There is no wrong way or right way, just the way that gets you done fast, and maintainable. You may begin using one way and find it may be easier trying another way, depending on what you're trying to do. The great thing is the flexibility.
catshirtover 14 years ago
why suffer the performance implications of client side rendering for something like partials?
评论 #2195953 未加载
评论 #2195976 未加载
评论 #2196001 未加载
评论 #2195948 未加载