08 Apr '12, 12am

Wow, when did @sinatra allow custom conditions?!

# app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_length # length of request.body request.media_type # media type of request.body request.host # "example.com" request.get? # true (similar methods for other verbs) request.form_data? # false request["SOME_HEADER"] # value of SOME_HEADER header request.referrer # the referrer of the client or '/' request.user_agent # user agent (used by :agent condition) request.cookies # hash of browser cookies request.xhr? # is this an ajax req...

Full article: http://www.sinatrarb.com/intro#Conditions

Tweets

Sinatra docs are now available in 11 languages....

sinatrarb.com 02 Apr '12, 10am

get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'tex...

Nike Dunk High "What the Dunk" Custom

Nike Dunk High "What the Dunk" Custom

nicekicks.com 05 Apr '12, 2pm

SB madness meets DIY ethic on the Nike Dunk High “What the Dunk” Custom . A “Mighty Crown” base finds El Cappy expanding h...

Sinatra Pusher example for realtime chat applic...

rubyflow.com 09 Apr '12, 12pm

Sinatra Pusher example for realtime chat applications Posted by injekt on April 09, 2012 — 0 comments I just knocked up an...