`
hideto
  • 浏览: 2666861 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

每天一剂Rails良药之Use Ajax to Trim Fast, Static Pages

    博客分类:
  • Ruby
阅读更多
今天让我们看看怎样使用Rails和Ajax得到静态页面。
看下面这个页面:
<ul>
    <li>
        <div id="product-1" class="product-overview">
            <span class="title">Learn to Program (Chris Pine)
                <%= link_to_remote "detail",
                    :update => 'product-1-detail',
                    :method => 'get',
                    :url => '/catalog/details/1.html' %>
            </span>
        </div>
        <div id='product-1-detail'></div>
    </li>
</ul>

这里link_to_remote生成一个detail链接,用户点击它时,就会取得1.html并替换id为product-1-detail的div的content。默认method为post,我们取静态内容所以改为get。
分享到:
评论

相关推荐

    Ajax on Rails

    This book teaches intermediate to advanced web developers how to use both Ajax and Rails to quickly build high-performance, scalable applications without being overwhelmed with thousands of lines of ...

    Ajax on Rails (PPT)

    在当今的Web开发领域,Ajax技术已经成为了提升用户体验的重要手段之一。Rails作为一种高效、优雅的Web开发框架,与Ajax技术结合能够创造出功能强大且易于维护的应用程序。本篇文章将基于给定的PPT文档“Ajax on ...

    Rails3-使用ajax处理并发

    Rails是一个流行的Web应用程序开发框架,它基于Ruby语言,而Ajax(Asynchronous JavaScript and XML)则是一种允许网页部分刷新的技术,无需重新加载整个页面。在Rails中,使用Ajax可以实现更流畅、更高效的用户体验...

    基于Rails2.2.2的ajax

    标签 "源码" 和 "工具" 暗示了可能在压缩包文件 "RailsAjax" 中包含了相关的示例代码或者工具,用于辅助学习和理解如何在Rails 2.2.2中实现AJAX。这些代码可能包括完整的应用示例、控制器、视图、模型以及相关的...

    Ajax-Rails-4-AJAX-Form.zip

    Ajax-Rails-4-AJAX-Form.zip,rails 4 ajax表单示例,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。它用于创建动态网页,其中网页的小部分在不重新加载网页的情况下...

    Beginning Google Maps Applications with Rails and Ajax From Novice to Professional.pdf

    本书旨在为读者提供一个全面了解如何使用Ruby on Rails(简称Rails)框架结合Ajax技术开发Google Maps应用的基础教程。无论是初学者还是有一定经验的开发者,都能从中获得实用的知识和技能。 - **目标读者**: - ...

    ajax on rails

    ajax on rails压缩包,全英文

    跨越边界 Ajax on Rails

    总的来说,《跨越边界 Ajax on Rails》是一本深入浅出的指南,它不仅解释了Ajax和Rails的结合,还提供了丰富的实践示例,帮助开发者构建更加动态和交互性强的Web应用。无论是初学者还是经验丰富的Rails开发者,都能...

    rails ajax提交文件或图片

    在Rails框架中,AJAX(Asynchronous JavaScript and XML)是一种常用的技术,用于创建动态和交互式的Web应用程序。AJAX允许页面在不刷新整个页面的情况下与服务器进行通信,从而提高用户体验。在本篇博文中,我们将...

    Beginning Google Maps Applications with Rails and Ajax: From Novice to Professional (part2)

    Beginning Google Maps Applications with Rails and Ajax: From Novice to Professional

    Beginning Google Maps Applications with Rails and Ajax: From Novice to Professional (part1)

    Beginning Google Maps Applications with Rails and Ajax: From Novice to Professional

    Ajax-Rails-4-AJAX-modal-form-render-JS-response-as-table-row.zip

    Ajax-Rails-4-AJAX-modal-form-render-JS-response-as-table-row.zip,rails 4 ajax模式表单将js响应呈现为表行,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。它用于...

    Rails Recipes英文版(清晰文字pdf+源码)

    Ruby三神书之一(其余的两本是Agile.Web.Development.with.Rails和Ruby For Rails,在我的资源列表也有) Rails is large, powerful, and new. How do you use it effectively? How do you harness the power? And, ...

    Beginning Ruby on Rails

    * How to install and use Ruby and Rails * Object-oriented programming with Ruby * Rails fundamentals and how to create basic online applications * How to work with HTML controls, use models in Rails ...

    Apress,.Beginning.Google.Maps.Applications.with.Rails.and.Ajax.

    《初识Google Maps应用:基于Rails和Ajax》是一本由Apress出版的技术书籍,专注于讲解如何使用Ruby on Rails框架和Ajax技术构建与Google Maps集成的应用程序。这本书详细介绍了如何利用Google Maps API,结合Web开发...

    Head First Rails A Learner's Companion to Ruby on Railsa.pdf

    《Head First Rails》是为学习Ruby on Rails的学习者提供的一个伴侣手册。本书是Head First系列的一部分,该系列书籍以其结合实际应用场景的教育方式而著称,旨在帮助读者快速掌握技能并迅速上手。《Head First ...

    跨越边界1:Ajax on Rails

    “Ajax on Rails”的强大之处在于,它将Rails的灵活性和Ajax的交互性完美结合,提供了构建现代Web应用的强大工具。通过了解和应用Ajax,开发者可以创建出更加动态、用户友好的Web界面,而Rails则为这一过程提供了...

Global site tag (gtag.js) - Google Analytics