This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
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.
- Loading branch information
1 parent
8acc465
commit 3b24b7a
Showing
5 changed files
with
44 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<a href="/">Back to home page</a> | ||
<a class="btn btn-primary" href="/">Back to home page</a> | ||
|
||
<h1>About me</h1> | ||
|
||
|
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,29 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>My Blog</title> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | ||
</head> | ||
<body> | ||
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<a class="navbar-brand" href="/">My Blog</a> | ||
</div> | ||
<div class="collapse navbar-collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a href="/about">About</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container" style="margin-top:60px; padding-top:20px"> | ||
|
||
<div class="starter-template"> | ||
<%= yield %> | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
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,22 +1,22 @@ | ||
<h1>Edit - <%= @post.title %></h1> | ||
|
||
<form action="/posts/<%= @post.id %>" method="post"> | ||
<form action="/posts/<%= @post.id %>" method="post" role="form"> | ||
<input type="hidden" name="_method" value="put" /> | ||
|
||
<label for="post_title">Title:</label><br /> | ||
<input id="post_title" name="post[title]" type="text" value="<%= @post.title %>" /> | ||
<input id="post_title" class="form-control" name="post[title]" type="text" value="<%= @post.title %>" /> | ||
<br /> | ||
|
||
<label for="post_text">Body:</label><br /> | ||
<textarea id="post_text" name="post[text]" rows="5"><%= @post.text %></textarea> | ||
<textarea id="post_text" class="form-control" name="post[text]" rows="5"><%= @post.text %></textarea> | ||
<br /> | ||
|
||
<input type="submit" value="Update" /> | ||
<input class="btn btn-success" type="submit" value="Update" /> | ||
</form> | ||
|
||
<h2>Delete this post</h2> | ||
|
||
<form action="/posts/<%= @post.id %>" method="post"> | ||
<input type="hidden" name="_method" value="delete" /> | ||
<input type="submit" value="Delete" /> | ||
<input class="btn btn-danger" type="submit" value="Delete" /> | ||
</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 |
---|---|---|
@@ -1,16 +1,13 @@ | ||
<h1>My Blog</h1> | ||
<a class="btn btn-success" href="/posts/new">Create new post</a> | ||
|
||
<a href="/posts/new">Create new post</a> | ||
<a href="/about">About</a> | ||
|
||
<ul> | ||
<% @posts.each do |post| %> | ||
<li id="post_<%= post.title.downcase.tr(" ", "_") %>"> | ||
<div class="panel panel-default" style="margin-top:20px"> | ||
<div class="panel-body" id="post_<%= post.title.downcase.tr(" ", "_") %>"> | ||
<h2> | ||
<a href="/posts/<%= post.id %>"><%= post.title %></a> | ||
</h2> | ||
Length: <%= post.number_of_characters %> | ||
<a href="/posts/<%= post.id %>/edit">Edit</a> | ||
</li> | ||
</div> | ||
</div> | ||
<% end %> | ||
</ul> |
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,13 +1,13 @@ | ||
<h1>New Post</h1> | ||
|
||
<form action="/posts" method="post"> | ||
<form action="/posts" method="post" role="form"> | ||
<label for="post_title">Title:</label><br /> | ||
<input id="post_title" name="post[title]" type="text" value="<%= @post.title %>" /> | ||
<input id="post_title" class="form-control" name="post[title]" type="text" value="<%= @post.title %>" /> | ||
<br /> | ||
|
||
<label for="post_text">Body:</label><br /> | ||
<textarea id="post_text" name="post[text]" rows="5"><%= @post.text %></textarea> | ||
<textarea id="post_text" class="form-control" name="post[text]" rows="5"><%= @post.text %></textarea> | ||
<br /> | ||
|
||
<input type="submit" value="Save" /> | ||
<input type="submit" value="Save" class="btn btn-success" /> | ||
</form> |