Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Invite #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,5 @@ DEPENDENCIES
sinatra
thin

RUBY VERSION
ruby 2.2.0p0

BUNDLED WITH
1.12.5
1.14.6
1 change: 1 addition & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class App < Sinatra::Base
post '/subscribe' do
@full_name = params[:full_name]
@email = params[:email]
@city = params[:city]

if [email protected](/.+@.+/)
redirect to('/?error=email')
Expand Down
6 changes: 4 additions & 2 deletions views/home.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1>Startup Sprint!</h1>
<img src="images/learnco.jpg">
<img src="images/learnco.jpg" alt="learnco">

<h3>Subscribe to the Stertup Sprint newsletter</h3>
<h3>Subscribe to the Startup Sprint newsletter</h3>
<% if @error == 'email' %>
<p style="color: red;">Please enter a valid email</p>
<% end %>
Expand All @@ -10,5 +10,7 @@
<input type="text" id="full-name" name="full_name" required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<label for="city">City</label>
<input type="text" id="city" name="city" required>
<input type="Submit">
</form>
2 changes: 1 addition & 1 deletion views/subscribe.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>Thanks for subscribing <%= @full_name %></p>
<p>Thanks for subscribing <%= @full_name %> from <%= @city %></p>

<a href="/">Home</a>