diff --git a/Gemfile.lock b/Gemfile.lock index 3b1fad1..679ee72 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,8 +70,5 @@ DEPENDENCIES sinatra thin -RUBY VERSION - ruby 2.2.0p0 - BUNDLED WITH - 1.12.5 + 1.14.6 diff --git a/app.rb b/app.rb index 68e111c..79fe431 100644 --- a/app.rb +++ b/app.rb @@ -9,6 +9,7 @@ class App < Sinatra::Base post '/subscribe' do @full_name = params[:full_name] @email = params[:email] + @city = params[:city] if !@email.match(/.+@.+/) redirect to('/?error=email') diff --git a/views/home.erb b/views/home.erb index 19d8743..ac5c231 100644 --- a/views/home.erb +++ b/views/home.erb @@ -1,7 +1,7 @@
Please enter a valid email
<% end %> @@ -10,5 +10,7 @@ + + diff --git a/views/subscribe.erb b/views/subscribe.erb index 6a5d527..fef8baa 100644 --- a/views/subscribe.erb +++ b/views/subscribe.erb @@ -1,3 +1,3 @@ -Thanks for subscribing <%= @full_name %>
+Thanks for subscribing <%= @full_name %> from <%= @city %>
Home