Skip to content

Instantly share code, notes, and snippets.

@skierkowski
Created May 1, 2015 22:39
Show Gist options
  • Save skierkowski/ea8931dc9fd7cbb4faea to your computer and use it in GitHub Desktop.
Save skierkowski/ea8931dc9fd7cbb4faea to your computer and use it in GitHub Desktop.
A demo of Grape route_params
require 'grape'
class API < Grape::API
resource :foo do
post do
{done:'done'}
end
route_param :id do
get do
puts "params: #{params}"
{yes:'sir'}
end
put do
puts "params: #{params}"
{yes:'sir'}
end
end
end
end
Rack::Handler::WEBrick.run(API.new, :Port => 9292)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment