public
Description: A Sinatra extension that turns a Sinatra app into a one page app using the teamwork of Sammy.
Homepage: http://code.quirkey.com/sammy
Clone URL: git://github.com/quirkey/sinatra-sammy.git
quirkey (author)
Tue Jun 09 16:22:49 -0700 2009
commit  0a295d07906853cfb69b3a1389af3d386b4b9c2a
tree    e9a33b91bf87ec12d11e77770222071a81a3a0dd
parent  105e57a969ecebcd1eded5ea638ccc6410985a93
name age message
file .gitignore Tue Jun 09 16:11:40 -0700 2009 Ignore pkg [quirkey]
file History.txt Tue Jun 09 15:19:54 -0700 2009 Updated Sammy to lastest and got POST forms wor... [quirkey]
file Manifest.txt Tue Jun 09 16:09:08 -0700 2009 Added version, pushing to github [quirkey]
file README.rdoc Tue Jun 09 16:11:40 -0700 2009 Ignore pkg [quirkey]
file Rakefile Tue Jun 09 16:09:08 -0700 2009 Added version, pushing to github [quirkey]
directory lib/ Tue Jun 09 16:09:08 -0700 2009 Added version, pushing to github [quirkey]
file sinatra-sammy.gemspec Tue Jun 09 16:22:49 -0700 2009 gemspec for github [quirkey]
directory spec/ Tue Jun 09 16:04:36 -0700 2009 Updated README [quirkey]
directory vendor/ Tue Jun 09 16:04:36 -0700 2009 Updated README [quirkey]
README.rdoc

sinatra-sammy

code.quirkey.com/sammy

DESCRIPTION:

A Sinatra extension that turns a Sinatra app into a one page app using the teamwork of Sammy.

FEATURES:

Three lines of code will give turn your one sinatra app into a one page app.

First,

  sudo gem install sinatra-sammy

Next, in your app:

  require 'sinatra'
  require 'sinatra-sammy' # Add me!

  class MyApp < Sinatra::Default

    register Sinatra::Sammy # Add me !

    get '/' do
      haml :index
    end

    # ...
  end

Finally, in your layout:

  !!!
  %html{:xmlns=> "http://www.w3.org/1999/xhtml", 'xml:lang' => "en", :lang => "en"}
    %head
      %meta{'http-equiv' => "Content-Type", 'content' => "text/html; charset=utf-8"}
      %title test_app2
      / Set :element_selector to the element that 'yields'
      = sammy(:element_selector => '#main')
    %body
      #main
        = yield

Done. One pager, without sacrificing SEO.

REQUIREMENTS:

Sinatra, a sinatra app, love of the universe.

INSTALL:

  sudo gem install sinatra-sammy

LICENSE:

(The MIT License)

Copyright © 2009 Aaron Quint, Quirkey NYC, LLC.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.