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.

Rails 3.1 has jQuery by default

85 pointsby vijaydevabout 14 years ago

4 comments

rsbrownabout 14 years ago
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 未加载
JangoSteveabout 14 years ago
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 未加载
clu3about 14 years ago
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 未加载
cygwin98about 14 years ago
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 未加载