Rails 3: Simple AJAXy Page updates?

前端 未结 6 2037
谎友^
谎友^ 2020-12-14 11:29

I can\'t believe I\'ve been looking four hours for this simple task, but I have.

In Rails 2.3, I could replace one section of a page with this simple code:

6条回答
  •  [愿得一人]
    2020-12-14 12:12

    The whole RJS stuff makes the javascript inline and makes the dom very obtrusive. Also, by avoiding inline javascript you could open up other possible ways of optimizing you javascript by compressing and caching those files in browser. Thats the reason why RJS is getting out of scope from rails 3. A little bit of getting around with jQuery or Prototype for a day should get you on gears with these kind of small stuff and will help the project on long run.

提交回复
热议问题