forked from zencephalon/sinatra-mvc-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from IliyanGanev/solo-iliyan
Add some forms
- Loading branch information
Showing
7 changed files
with
89 additions
and
60 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
<h1> sessions/new page </h1> | ||
<form method = "post" action = "/sessions"> | ||
<label>Username:</label> | ||
<input type = "text" name = "user[username]"> | ||
<h1>Login</h1> | ||
<br> | ||
<label>Password:</label> | ||
<input type = "password" name = "user[password]"> | ||
<br> | ||
<input type = "submit", value = "Login"> | ||
<form action = "/sessions" method = "post"> | ||
<label>Username:</label><br> | ||
<input type = "text" name = "username"> | ||
<br> | ||
<label>Password:</label><br> | ||
<input type = "password" name = "password"> | ||
<br> | ||
<input type = "submit", value = "Login"> | ||
</form> | ||
|
||
<%= erb :'_errors' %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<h1>Edit user details</h1> | ||
|
||
|
||
<form method="post" action="/users/<%= @user.id %>"> | ||
<input type="hidden" name="_method" value="put" /> | ||
|
||
<label for="username">username:</label><br> | ||
<input id="user_name" name="user[username]" type="text" value="<%= @user.username %>"><br> | ||
|
||
<label for="user_email">Email</label><br> | ||
<input id="user_email" name="user[email]" type="text" value="<%=@user.email %>"/><br> | ||
|
||
<label for="user_password">Password</label><br> | ||
<input id="user_password" name="user[password]" type="password"/> | ||
|
||
<input type="submit" value="Edit User" class="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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<h1>All Users</h1> | ||
<div class="users"> | ||
<ul> | ||
<% @users.each do |user| %> | ||
<li><%= "#{user.username} - #{user.email}"%> - <a href="/users/<%=user.id %>">Show details</a> | ||
<a href="/users/<%=user.id %>/edit">Edit</a> | ||
|
||
<form method="post" action="/users/<%=user.id %>"> | ||
<input name="_method" type="hidden" value="delete" /> | ||
<input name="commit" type="submit" value="Delete"/> | ||
</form> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,10 @@ | ||
<h1>NEW USER PAGE</h1> | ||
</br> | ||
</br> | ||
<h1>New User Page</h1> | ||
|
||
<form method = "post" action = "/users"> | ||
<label>username:</label> | ||
<input type = "text" name = "user[username]"> | ||
</br> | ||
<label>email:</label> | ||
<input type = "email" name = "user[email]"> | ||
<br> | ||
<label>Password:</label> | ||
<input type = "password" name = "user[password]"> | ||
<br> | ||
<input type = "submit", value = "Register User"> | ||
<input type = "text" name = "user[username]" value="<%=@user.username %>" placeholder="enter username"><br> | ||
<input type = "email" name = "user[email]" value="<%=@user.email %>" placeholder="enter email"><br> | ||
<input type = "password" name = "user[password]" placeholder="enter password"><br> | ||
<input type = "submit", value = "Register User"> | ||
</form> | ||
|
||
|
||
|
||
<%= erb :'_errors' %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
|
||
<h1>Page showing User info with option to logout or do other things</h1> | ||
<h1>users show</h1> | ||
|
||
<h1><%= @user.username%> </h1> | ||
|
||
<h1><%= @user.email%> </h1> | ||
<form method = "post" action = "/sessions/:id"> | ||
<input type = "hidden" name = "_method" value = "delete"> | ||
<input type = "submit" value = "logout"> | ||
<input type = "hidden" name = "_method" value = "delete"> | ||
<input type = "submit" value = "logout"> | ||
</form> | ||
|
||
<a href='/users'>show all users</a> | ||
|
||
|
||
|
||
<a href='/restaurants/new'>DO A THING</a> |