Rails 3.1 原型-rails
Rails 3.1 的新原型-rails gem 允许 RJS 和原型支持也可以与 JQuery-UJS 一起使用,以允许 JQuery 与 RJS(即 JS 模板及其助手)一起使用吗?
确认:我不想使用原型,我希望 JQuery 能够在 3.1 下使用 JS 模板。
Can the new prototype-rails gem for Rails 3.1 which allows RJS and prototype support also be used with JQuery-UJS to allow JQuery to be used with RJS that is JS templates and its helpers?
To confirm : I dont wish to use prototype I want JQuery to work with JS templates under 3.1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是想说你想在rails项目中使用prototype和jquery吗?如果你坚持那么我想问为什么,因为两者都“尝试”达到相似的结果。为什么你想携带两个火箭筒杀死一个人……;)
不过,如果你坚持的话,如果一起使用,它们会发生冲突。我建议不要在布局文件(application.html.erb)中包含 javascript 库,并在应用程序中使用一些代码将它们单独包含在各个页面(取决于您对不同页面的选择)或控制器特定布局中。 html.erb,或您认为合适的任何其他方式。但要警告你——那是丑陋的!
Are you trying to say that you want to use prototype as well as jquery in rails project? If you insist then I would like to ask why, because both 'try' to achieve similar results. Why would you like to carry two bazookas to kill a single person... ;)
Still if you insist, they conflict if used together. I would suggest that don't include the javascript libraries in your layout file(application.html.erb) and include them separately in individual pages (depending on your choice for different pages), or controller specific layouts, using some code in application.html.erb, or any other way you deem fit. But to warn you - that is ugly!