diff options
-rw-r--r-- | registration.rb | 8 | ||||
-rw-r--r-- | spec/registration_spec.rb | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/registration.rb b/registration.rb index c6598d1..0f1ac34 100644 --- a/registration.rb +++ b/registration.rb @@ -6,9 +6,10 @@ class RegistrationApp < Sinatra::Base helpers Sinatra::UrlForHelper include ERB::Util + enable :sessions + get '/' do - @errors = request['errors'] - @errors = @errors.split('|') if @errors + @errors = session['errors'] erb :index end @@ -21,7 +22,8 @@ class RegistrationApp < Sinatra::Base send_registration_emails_for @band erb :submitted else - redirect to(url_for('/', :errors => @band.errors.join('|'))) + session['errors'] = @band.errors + redirect to('/') end end end diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb index 3d7deed..d76d59e 100644 --- a/spec/registration_spec.rb +++ b/spec/registration_spec.rb @@ -1,4 +1,5 @@ require "prawn" +require 'rack/session/cookie' describe RegistrationApp do include Rack::Test::Methods |