• Stars
    star
    205
  • Rank 191,264 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pjax for rails and rack applications

Rack-pjax travis

Rack-pjax is middleware that lets you serve 'chrome-less' pages in respond to pjax-requests.

It does this by stripping the generated body; only the title and inner-html of the pjax-container are sent to the client.

While this won't save you any time rendering the page, it gives you more flexibility where and how to define the pjax-container. Ryan Bates featured rack-pjax on Railscasts and explains how this gem compares to pjax_rails.

railscast

Installation

Check out the Railscasts' notes how to integrate rack-pjax in your Rails 3.1 application.

You can find the source from the screencast over here.

Another sample-app: the original pjax-demo but with rack-pjax onboard can be found in the sample-app branch.

The more generic installation comes down to:

I. Add the gem to your Gemfile

# Gemfile
gem "rack-pjax"

II. Include rack-pjax as middleware to your application(-stack)

# config.ru
require ::File.expand_path('../config/environment',  __FILE__)
use Rack::Pjax
run RackApp::Application

III. Install jquery-pjax. Make sure to add the 'data-pjax-container'-attribute to the container.

<head>
  ...
  <script src="/javascripts/jquery.js"></script>
  <script src="/javascripts/jquery.pjax.js"></script>
  <script type="text/javascript">
    $(function(){
      $(document).pjax('a', '[data-pjax-container]')
    })
  </script>
  ...
</head>
<body>
  <div data-pjax-container>
    ...
  </div>
</body>

(For more see the docs of jquery-pjax.)

IV. Fire up your pushState-enabled browser and enjoy!

Requirements

  • Nokogiri

Contributors

The contributors.

More Repositories

1

envied

Ensures presence and type of your app's ENV-variables (mirror)
Ruby
331
star
2

deps-try

Try out Clojure (libraries) via rebel-readline
Clojure
120
star
3

malli-select

spec2-inspired selection of Malli-schemas
Clojure
32
star
4

total_recall

Turn any csv into Ledger journals. Canonical repository can be found at -->
Ruby
16
star
5

bbangsearch

DuckDuckGo's bang searches from the commandline
Clojure
11
star
6

csv-omg

Easily map CSV to objects
Ruby
6
star
7

su_attr_accessibility

Define roles that have access to all attributes of an AR-model
Ruby
4
star
8

bubble-config

An aero powered config with environments aimed at Babashka tasks.
Clojure
4
star
9

actions

Light, sound รกaand action! ๐ŸŽ๏ธ
Clojure
4
star
10

otarta

An MQTT-library for ClojureScript
Clojure
3
star
11

gem-outdated

gem outdated => gem outdated STRING
Ruby
3
star
12

sudo_attr_accessibility

Renamed to 'su_attr_accessibility'
Ruby
3
star
13

qtunes

add songs to queue, let cmus eat it
Ruby
2
star
14

bundle-try

Start a REPL with the gems you want to try
Ruby
2
star
15

respectable

Test different inputs against an rspec-expectation (mirror)
Ruby
2
star
16

gem-try

Fire up an IRB-session with gems loaded
Ruby
1
star
17

bangbanggo

Browser extension to support bang searches.
Clojure
1
star
18

spark-cljs

Port of https://github.com/holman/spark in clojurescript
Clojure
1
star
19

lemme-pry

(mirror) Start a pry-session with specific gems or a (remote) script loaded.
Ruby
1
star
20

bunny_drain

Heroku logs => AMQP
Ruby
1
star
21

mollie-payment

Client for the Mollie API (currently iDEAL-only)
Ruby
1
star
22

temp

1
star