All about
Sammy
Who is Sammy?
A Clientside
  JavaScript
 Framework
Inspired by Sinatra, a server-side
framework from the Ruby World

       and created by:
  Aaron Quint :: quirkey.com
For single-page apps
(no-reload, a la gmail)
Using the URL Hash
            (#...)
http://yourapp.com/#/
http://yourapp.com/#/posts
http://yourapp.com/#/posts/hello-world
Remains bookmarkable
 Retains “back” button
Built on jQuery
Tiny
About 7kb when minified
The App
Application Function
Routes
verb + path + callback
Example: a little jQuery
Verbs
GET, POST, PUT, DELETE, and bind
Client-Side Forms
  This is where ‘post’ comes in...
Create a “post” route
  “posts” have access to a params hash
Route Paths

•   Can be a string      '#/say_my_name'

•   Or a regular expression /#/by_name/(.*)/ params[‘splat’]

•   Named params         '#/by_name/:name'     params[‘name’]
Binding
Routes that respond to internal events
Triggering
Execute bound routes with trigger(event_name, ...)
Bind/Trigger Example
Templates & Partials
ERB style notation. HTML, substitute variables, etc.




      Template file: “task_details.html.erb”
Multiple apps, one page

• each app bound to specific element
• unique ID and namespace
• possible to create controller apps for
  individual elements, widgets, etc.
Data Storage

• CouchDB
• CloudKit
• Client-side Storage

       So many buzzwords, so little time...
Thanks!
Scott Becker - http://synthesis.sbecker.net
       http://twitter.com/sbecker