Skip to content

Instantly share code, notes, and snippets.

@k00ka
Created April 21, 2015 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k00ka/3e5129aaaf4d51f13c61 to your computer and use it in GitHub Desktop.
Save k00ka/3e5129aaaf4d51f13c61 to your computer and use it in GitHub Desktop.
W5D1 Lighthouse PT Toronto
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
profile
<form action="/profile" method="POST">
<input type="text" name="username" />
<button type="submit">Update profile</button>
</form>
profile updated
Hey, we got the value <%= @username %> for the username parameter!
sign in
<form method="POST" action="/sign-in">
<button type="submit">Sign in</button>
</form>
This is my signup page!
<form action="/sign-up" method="POST">
<button type="submit">Sign up</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment