Posted On: Feb 22, 2018
//Enabling Session enable :sessions get '/foo' do // setting session value session[:message] = 'Hello World!' redirect to('/bar') end get '/bar' do // getting session value session[:message] # => 'Hello World!' end
Never Miss an Articles from us.
Sinatra is web application framework for rapidly building applications in Ruby.Sinatra is a domain specific language or..
Rack:: Flash is used to flash a message in Sinatra.Example Usage :require 'sinatra/base' require 'rack-flash'class My..
The request object probably has what you’re looking for:get '/hello-world' do request.path_info # => '/hello-w..