Sinatra

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Sinatra - Presentation Transcript

    1. Sinatra Ryan Farnell (@criscokid)
    2. What is Sinatra?
    3. Micro Web Framework • Built on top of Rack • Uses RESTful thinking • URL’s are king
    4. Features • Routing to code blocks • Static Files • Views/Layouts • Filters • Helpers
    5. Routing To Blocks • Routes made up of 3 basic parts • HTTP Verb • Match Expression • Code block
    6. HTTP Verbs POST GET PUT DELETE
    7. Demo
    8. Serving Public Files • If no matching URL was found, Sinatra checks the public folder • Public folder can be changed by setting :public set :public,'path/to/file/static'
    9. Viewsmarkup • Views are mixes of code and • Sinatra works with ERB, HAML, and Builder by default • Views are kept in a folder at the root of the site called “views” • View folder can be changed by setting :views set :views,,'path/to/file/static'
    10. Layout • Layouts are like templates for all your pages. • Bydefault looks for a file called “layout” in views with the same extension as the view you are rendering. • Default name can be overridden.
    11. Demo
    12. Filters • Filters run before all routes. • Theycan modify the Request and Response object. • Any instance variable created in the before filter is available in the route.
    13. Helpers • Small methods that you find useful. • Available within the route and within the views.
    14. Demo
    15. Example Apps
    16. Git-Wiki http://atonie.org/2008/02/git-wiki
    17. Rif-Graf http://rifgraf.heroku.com/
    18. Github-Services http://github.com/pjhyett/github-services/tree/maste
    19. Deployment • Any server compatible with Rack • Ruby Servers • Mongrel • Thin • Webrick • Apache running mod_rack (Phusion Passenger) • FastCGI Server • Apache • Lighttpd
    20. http://www.sinatrarb.com/
    21. Q&A

    + tobias382tobias382, 5 months ago

    custom

    607 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 607
      • 607 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 5
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories