Successfully reported this slideshow.

All About Sammy

6

Share

Upcoming SlideShare
Intro To Sammy
Intro To Sammy
Loading in …3
×
1 of 23
1 of 23

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

All About Sammy

  1. 1. All about Sammy
  2. 2. Who is Sammy?
  3. 3. A Clientside JavaScript Framework Inspired by Sinatra, a server-side framework from the Ruby World and created by: Aaron Quint :: quirkey.com
  4. 4. For single-page apps (no-reload, a la gmail)
  5. 5. Using the URL Hash (#...) http://yourapp.com/#/ http://yourapp.com/#/posts http://yourapp.com/#/posts/hello-world
  6. 6. Remains bookmarkable Retains “back” button
  7. 7. Built on jQuery
  8. 8. Tiny About 7kb when minified
  9. 9. The App
  10. 10. Application Function
  11. 11. Routes verb + path + callback
  12. 12. Example: a little jQuery
  13. 13. Verbs GET, POST, PUT, DELETE, and bind
  14. 14. Client-Side Forms This is where ‘post’ comes in...
  15. 15. Create a “post” route “posts” have access to a params hash
  16. 16. Route Paths • Can be a string '#/say_my_name' • Or a regular expression /#/by_name/(.*)/ params[‘splat’] • Named params '#/by_name/:name' params[‘name’]
  17. 17. Binding Routes that respond to internal events
  18. 18. Triggering Execute bound routes with trigger(event_name, ...)
  19. 19. Bind/Trigger Example
  20. 20. Templates & Partials ERB style notation. HTML, substitute variables, etc. Template file: “task_details.html.erb”
  21. 21. Multiple apps, one page • each app bound to specific element • unique ID and namespace • possible to create controller apps for individual elements, widgets, etc.
  22. 22. Data Storage • CouchDB • CloudKit • Client-side Storage So many buzzwords, so little time...
  23. 23. Thanks! Scott Becker - http://synthesis.sbecker.net http://twitter.com/sbecker

×