Upgrade to Pro — share decks privately, control downloads, hide ads and more …

pjax+Rails

 pjax+Rails

A Ruby on Rails application that demonstrates advanced pjax integration.

This demo was presented at Ruby::AZ (http://rubyaz.org) on March 18th, 2014.

Sponsored by Software Ops (http://softwareops.com). We build mobile app systems.

Avatar for Bruce White

Bruce White

March 18, 2014

More Decks by Bruce White

Other Decks in Programming

Transcript

  1. Who is pjax? • pjax = pushState + ajax •

    A jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles, and a working back button • For browsers that don't support pushState pjax fully degrades • https://github.com/defunkt/jquery-pjax
  2. Turbolinks “You’re Soaking In It” • Rails 4 includes a

    pjax-like feature called Turbolinks • Turbolinks and pjax+Rails are not compatible - yet
  3. pjax+Rails “Two great tastes that taste great together” • Combine

    the use of pjax with Ruby on Rails • Use the rack-pjax gem to minimize the HTML sent to the browser • Multiple pjax container support • Form and link support • Skip layout rendering on pjax requests
  4. When To Use pjax+Rails You Want ajax-Like Responsiveness But… •

    You are new to Ruby on Rails or Javascript or • You want a simple architecture or • You are in a hurry
  5. Let’s See Some Code! Full source for this presentation is

    available at:
 https://github.com/SoftwareOps/pjax_rails_demo