Advertisement
Advertisement

More Related Content

Advertisement

Ramaze - The Underrated Ruby Web Framework

  1. The Underrated Web Framework
  2. underrated: Not given enough recognition for its quality
  3. Motivation
  4. Getting Started
  5. Simple Light Modular
  6. sudo gem install ramaze
  7. http://github.com/manveru/ramaze
  8.  
  9.  
  10. Features
  11. M V C
  12. KISS
  13. Modular
  14. Only one dependency
  15. ORM-agnostic
  16. Well Documented
  17. Beautiful Code
  18. BDD
  19. Ruby 1.9
  20. IRC Population
  21. Basics
  22. Controllers
  23. MainController maps to '/'
  24. BlueController maps to '/blue'
  25. ...unless you use map
  26. _ .
  27. Action methods accept arguments via URL
  28. http://localhost:7000/archive? page=2 request[:page] == '2'
  29. Errors redirect to error action
  30. Routing (String Routers) Ramaze::Route [ '/foo' ] = '/bar' # '/foo' => '/bar'
  31. Routing (Regex Routers) Ramaze::Route [ %r!^/(+)txt$! ] = "/text/%d" # '/123.txt' => '/text/123'
  32. Routing Ramaze::Route [ 'name of route' ] = lambda { |path, request| '/bar' if path == '/foo' and request[ :bar ] == '1' } (Lambda Routers) # '/foo' => '/foo' # '/foo?bar=1' => '/bar'
  33. Testing
  34. Views
  35. Ezamar Erubis (bundled) (default) (my favorite) (plenty of other choices)
  36. inline vs. external
  37. START NO YES Run return value of action through templating engine Send to browser External Template Is there an external template?
  38. Instance variables set in the action can be accessed in template (just like in Rails)
  39. (convention) /view
  40. (configuration) view_root 'my_templates'
  41. Layouts
  42. # apply to all actions except index layout :layout deny_layout :index # apply only to index layout :layout => [ :index ] Layouts
  43. Ezamar Very simple reimplementation of the Templating-engine found in Nitro. <?r rubycode ?> == <% rubycode %> #{ rubycode } == <%= rubycode %>
  44. Ezamar::Element
  45. Ezamar::Element
  46. Models
  47. That's up to you to figure out...
  48. ActiveRecord DataMapper Sequel Og DBI
  49. Ramaze::Store
  50. Helpers
  51. Link Helper R(AdminController, :index) => /admin/index Rs(:index) => /admin/index Rs(:/) => / A('text') => <a href=”/text”>text</a> A('foo/bar') => <a href=”/foo/bar”>foo/bar</a> A('Home', :href => Rs(:/)) => <a href=”/”>Home</a>
  52. Aspect Helper Allows you to wrap different Actions on your Controller with code.
  53. Extras
  54.  
  55. Deployment thin start --servers 1 --socket /tmp/thin-socket -R start.ru
  56. Live Coding Small Blog Example: http://pastie.org/319647
  57. RTFC
  58. Thank you. Questions?

Editor's Notes

  1. Good afternooon everyone. My name is Luc Castera and I&apos;m going to talk to you about Ramaze today.
Advertisement