From 1c48f48073e33875650b687ced05a51e0fd7f7d3 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 3 Oct 2015 17:41:27 +0200 Subject: Add route to handle submitted form. --- registration.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'registration.rb') diff --git a/registration.rb b/registration.rb index de9ec75..9fae54f 100644 --- a/registration.rb +++ b/registration.rb @@ -1,4 +1,5 @@ require 'sinatra/base' +require_relative 'lib/band' class RegistrationApp < Sinatra::Base @@ -6,5 +7,14 @@ class RegistrationApp < Sinatra::Base erb :index end + post '/submit' do + if request.form_data? + #p request['band'] + @band = Band.new(request['band']) + + erb :submitted + end + end + run! if app_file == $0 end -- cgit v1.2.3