Friday, 6 September 2013

How to add two parameters in the url

How to add two parameters in the url

How can I display in my web page the result of int1 + int2? And can I know
if it's an integer or a string? Here is my code:
require 'sinatra'
get '/add/:int1/:int2' do
puts #{params[:int1]} + #{params[:int2]}
end

No comments:

Post a Comment