Skip to content

Commit

Permalink
requests erb added
Browse files Browse the repository at this point in the history
  • Loading branch information
Student authored and Student committed Feb 27, 2020
1 parent 65a8310 commit cc4d4cc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ class MakersBnB < Sinatra::Base
end
end

post '/requests' do
"Hi, #{User.all.last.name}. Here are you requests"
erb :"requests"
end


post '/users' do
User.create(name: params['name'], email: params['email'], password: params['password'])
redirect '/welcome'
redirect '/login'
end

get '/welcome' do
Expand Down
2 changes: 1 addition & 1 deletion views/login.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ f {

<h1>Login in below, friends!</h1>

<form action="/" method="post">
<form action="/session/new" method="post">

<label for="email">Email:</label></br>
<input type="email" name="email"/></br>
Expand Down
22 changes: 22 additions & 0 deletions views/requests.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html>
<head>
<link type='text/css' rel='stylesheet' href='/css/styles.css'>
</head>
<body>

<h1>Here are your requests</h1>



<form action="/sessions/destroy" method="post">
<input type="submit" value='Sign out' />
</form>

<form action="/spaces/index" method="post">
<input type="submit" value='Home' />
</form>

<a href="/spaces">Homepage</a></br>

</body>
</html>
7 changes: 7 additions & 0 deletions views/spaces/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<input type="submit" value='Sign out' />
</form>

<form action="/requests" method="post">
<input type="submit" value='View requests' />
</form>




<% Space.all.each do |space| %>
<img src='<%= space.photo_url %>' height='420' width='auto'></br>
Name: <%= space.name %></br>
Expand Down

0 comments on commit cc4d4cc

Please sign in to comment.