• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
SINATRA + HAML + TWITTER
 

SINATRA + HAML + TWITTER

on

  • 2,325 views

Segunda apresentação no bbti techtalk.

Segunda apresentação no bbti techtalk.

Statistics

Views

Total Views
2,325
Views on SlideShare
2,292
Embed Views
33

Actions

Likes
0
Downloads
20
Comments
0

3 Embeds 33

http://dynaum.com 29
http://localhost 3
http://web.archive.org 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    SINATRA + HAML + TWITTER SINATRA + HAML + TWITTER Presentation Transcript

    • SINATRA + HAML + TWITTER Elber Ribeiro @dynaum BBTI TechTalk #2 17/09/2010
    • SINATRA Micro Web Framework
    • SINATRA •RACK •REST •URL
    • EXEMPLO require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    • EXEMPLO $ gem install sinatra $ ruby hello.rb >> Listen on 0.0.0.0:4567
    • EXEMPLO require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    • EXEMPLO require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    • EXEMPLO require 'rubygems' require 'sinatra' get '/hi' do "Hello World!" end
    • EXEMPLO require 'rubygems' require 'sinatra' get '/hi' do erb :index end
    • EXEMPLO require 'rubygems' require 'sinatra' require 'haml' get '/hi' do haml :index end
    • URL PADRONIZADA require 'rubygems' require 'sinatra' require 'haml' post '/posts' do post = Post.create! params redirect “/posts/#{post.id}” end get '/posts/:id' do @post = Post.find(params[:id]) haml :post end
    • MAIS • Template ( erb, haml, builder ) • Testes ( rspec, test::unit ) • Before filters • Helpers • Error handlers • Inline templates • HTTP Caching ( etag, last-modified ) • Rack
    • NICEDOG
    • NICEDOG require 'NiceDog.php'; R('/posts')->controller('post')->action('index')->on('GET'); class Post extends C{ public function index(){ echo 'Hello'; } } run();
    • NICEDOG + LASA = LASA_API • Conexão entra apps ruby com o sap (RFC) • Login AD (apenas teste ainda)
    • ERB <div id="profile"> <div class="left column"> <div id="date"><%= print_date %></div> <div id="address"><%= current_user.address %></div> </div> <div class="right column"> <div id="email"><%= current_user.email %></div> <div id="bio"><%= current_user.bio %></div> </div> </div>
    • HAML #profile .left.column #date= print_date #address= current_user.address .right.column #email= current_user.email #bio= current_user.bio
    • TUTORIAL ERB <strong><%= item.title %></strong> Haml %strong= item.title
    • TUTORIAL HTML <strong class="code" id="msg">Hello!</strong> Haml %strong{:class => "code", :id => "msg"} Hello!
    • TUTORIAL Haml .content Hello, World! HTML <div class='content'>Hello, World!</div>
    • CSS table.hl { margin: 2em 0; } table.hl td.ln { text-align: right; } li { font-family: serif; font-weight: bold; font-size: 1.2em; }
    • SASS table.hl margin: 2em 0 td.ln text-align: right li font: family: serif weight: bold size: 1.2em
    • EM BREVE
    • É ISSO! Elber Ribeiro dynaum.com @dynaum