Sha256: 9e8cb23bbde0e649d8a39aaace13d52ff62c24ee97ca54514116e5b650f0f639

Contents?: true

Size: 971 Bytes

Versions: 7

Compression:

Stored size: 971 Bytes

Contents

get '/' do
  "You said #{ params[:say] || 'nothing' }"
end
post '/' do
  "You said #{ params[:say] || 'nothing' }"
end

# can i roll these into 1?
get '/print-method' do
  request.request_method.downcase
end
put '/print-method' do
  request.request_method.downcase
end
post '/print-method' do
  request.request_method.downcase
end

get '/print-session' do
  session[:session_variable] = params[:session_variable] if params[:session_variable]
  session[:session_variable].to_s
end
post '/print-session' do
  session[:session_variable] = params[:session_variable] if params[:session_variable]
  session[:session_variable].to_s
end

get '/redirect' do
  redirect params[:to]
end

get '/relative' do
  redirect '/i_am_relative'
end

get '/some_text' do
  'hello there, how goes it?'
end

get '/some_html' do
  haml :some_html
end

use_in_file_templates! 

__END__

@@ layout
%html
  %body
    = yield

@@ some_html
%p#this-one
%p#bacon-one
#chunky-one
  %b chunky one
  %div

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
remi-rackbox-1.1.0 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.1 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.2 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.3 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.4 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.5 examples/sinatra/sinatra_app.rb
remi-rackbox-1.1.6 examples/sinatra/sinatra_app.rb