Skip to content

Instantly share code, notes, and snippets.

@onliniak
Created September 16, 2019 13:25
Show Gist options
  • Save onliniak/d705990f0dcb5fa01bc90baa5d9986be to your computer and use it in GitHub Desktop.
Save onliniak/d705990f0dcb5fa01bc90baa5d9986be to your computer and use it in GitHub Desktop.
Receive POST parameters from rack/Roda app
class Test < Roda
route do |r|
r.root do
'<form action="login" method="post">
<input type="email" name="user">
<input type="password" name="pass">
<input type="submit">
</form>'
end
r.post 'login' do
email = request.POST['user']
pass = request.POST['pass']
end
end
end
require 'roda'
require File.expand_path('app', File.dirname(__FILE__))
run Test.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment