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

Email bullshit #6

Open
wants to merge 7 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
Empty file modified Gemfile
100644 → 100755
Empty file.
Empty file modified Gemfile.lock
100644 → 100755
Empty file.
Empty file modified Procfile
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified Rakefile
100644 → 100755
Empty file.
3 changes: 2 additions & 1 deletion app.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class App < Sinatra::Base
get '/' do
@error = params['error']
@full_name = params['full_name']
erb :home
end

Expand All @@ -11,7 +12,7 @@ class App < Sinatra::Base
@email = params[:email]

if [email protected](/.+@.+/)
redirect to('/?error=email')
redirect to('/?error=email&full_name='+@full_name)
end

erb :subscribe
Expand Down
Empty file modified config.ru
100644 → 100755
Empty file.
Empty file modified config/environment.rb
100644 → 100755
Empty file.
Empty file modified models/.keep
100644 → 100755
Empty file.
Empty file modified models/sample_model.rb
100644 → 100755
Empty file.
Empty file modified public/images/.keep
100644 → 100755
Empty file.
File renamed without changes.
Empty file modified public/images/learnco.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified public/javascripts/.keep
100644 → 100755
Empty file.
Empty file modified public/stylesheets/.keep
100644 → 100755
Empty file.
Empty file modified public/stylesheets/main.css
100644 → 100755
Empty file.
Empty file modified spec/spec_helper.rb
100644 → 100755
Empty file.
Empty file modified views/.keep
100644 → 100755
Empty file.
30 changes: 19 additions & 11 deletions views/home.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<h1>Startup Sprint!</h1>
<img src="images/learnco.jpg">
<img src="images/learnco.png">

<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 %>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<input type="Submit">
</form>
<p style="color: red;"><%= @full_name %>, please enter a valid email</p>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" value=<%= @full_name %> required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<input type="Submit">
</form>
<%else%>
<form method=POST action="/subscribe">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full_name" required>
<label for="email">Email</label>
<input type="text" id="email" name="email" required>
<input type="Submit">
</form>
<% end %>
Empty file modified views/layout.erb
100644 → 100755
Empty file.
Empty file modified views/reddit.erb
100644 → 100755
Empty file.
Empty file modified views/schedule.erb
100644 → 100755
Empty file.
Empty file modified views/subscribe.erb
100644 → 100755
Empty file.