TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rails 3.1 has jQuery by default

85 点作者 vijaydev大约 14 年前

4 条评论

rsbrown大约 14 年前
Finally. As "opinionated software", the success of Rails depends on neatly slotting into the well-worn groove of best practices adopted by its user base. Like it or not, jQuery has filled that role nicely for client-side javascript for quite a while now.
评论 #2470752 未加载
JangoSteve大约 14 年前
If anyone is curious, the default accepts header in jQuery is<p><pre><code> */* </code></pre> which means, "give me whatever you have." This will actually cause Rails to respond with whatever the first format is that you happen to have defined with your respond_to or respond_with method in your controller.<p>This isn't very intuitive, which is why we made the jquery-ujs set the default accepts header for remote requests to<p><pre><code> */*;q=0.5,text/script </code></pre> which says, "give me whatever you have but I prefer JavaScript if you have it."
评论 #2470849 未加载
评论 #2471212 未加载
clu3大约 14 年前
I'm not a RoR boy, but sometimes watch RoR screencasts to pick out good points. Really surprised that RoR was using its own JS library and has not adopted any other dedicated js lib out there Drupal for example, initially had its own js lib, but then adopted jQuery officially many years ago<p>Edited: I must have misunderstood the RJS's purpose. Thought it was a JS lib, but it's not, it's just a way to generate JS code. And so i learned RoR's been using prototype. Sorry RoR fans, my bad
评论 #2470408 未加载
评论 #2470415 未加载
评论 #2470405 未加载
评论 #2470410 未加载
cygwin98大约 14 年前
I recall there was a post a week ago saying that Rails 3.1 will go with CoffeeScript. Maybe they received lots of negative feedback on that shot, so they fall back to plan B.
评论 #2470814 未加载
评论 #2470830 未加载
评论 #2471881 未加载
评论 #2470919 未加载
评论 #2470920 未加载