Created
April 21, 2015 01:42
-
-
Save k00ka/3e5129aaaf4d51f13c61 to your computer and use it in GitHub Desktop.
W5D1 Lighthouse PT Toronto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
account created |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
#erb :index | |
redirect '/sign-in' | |
end | |
get '/sign-in' do | |
erb :sign_in | |
end | |
post '/sign-in' do | |
# validate the form here | |
# retrieve the user here | |
# check if password matches here | |
erb :signed_in | |
end | |
get '/sign-up' do | |
erb :sign_up | |
end | |
post '/sign-up' do | |
# validate the form here | |
# create a new user here | |
erb :account_created | |
end | |
get '/profile' do | |
erb :profile | |
end | |
post '/profile' do | |
@username = params[:username] | |
# validate the form here | |
# update the profile here | |
erb :profile_updated | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profile | |
<form action="/profile" method="POST"> | |
<input type="text" name="username" /> | |
<button type="submit">Update profile</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
profile updated | |
Hey, we got the value <%= @username %> for the username parameter! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sign in | |
<form method="POST" action="/sign-in"> | |
<button type="submit">Sign in</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is my signup page! | |
<form action="/sign-up" method="POST"> | |
<button type="submit">Sign up</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signed in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment