Skip to content
Myr

Added posts to the reoute separation example

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 14a22d9 · Browse files · 8 files+42 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

8 files+42 added−3 removed

  • other:+42 added−3 removed

8 files+42 added−3 removed

modified:examples/route-separation/public/style.css+6 added
added:examples/route-separation/views/post/list.ejs+7 added
1<h1>Posts</h1>2<dl id="posts">3 <% posts.forEach(function(post){ %>4 <dt><%= post.title %></dt>5 <dd><%= post.body %></dd>6 <% }) %>7</dl>
modified:examples/route-separation/views/user/edit.ejs+1 added-1 removed
1<h1>Editing <%= user.name %></h1>2<div id="user">2 <h1>Editing <%= user.name %></h1>3 <form method="post">4 <input type="hidden" value="put" name="_method" />5 <p>Name: <input type="text" value="<%= user.name %>" name="user[name]"/></p>6 <p>Email: <input type="text" value="<%= user.email %>" name="user[email]"/></p>
3 unmodified lines
modified:examples/route-separation/views/user/list.ejs+1 added
1<h1>Users</h1>2<ul id="users">3 <% users.forEach(function(user, id){ %>4 <li>5 <a href="/user/<%= id %>"><%= user.name %></a>
4 unmodified lines
modified:examples/route-separation/views/user/view.ejs+1 added-1 removed
1<h1><%= user.name %></h1>2<div id="user">2 <h1><%= user.name %></h1>3 <p>Email: <%= user.email %></p>4</div>
modified:examples/route-separation/views/index.ejs+4 added-1 removed
1<p>Visit the <a href="/users">users</a> page</p>1<ul>2 <li>Visit the <a href="/users">users</a> page</li>3 <li>Visit the <a href="/posts">posts</a> page</li>4</ul>
modified:examples/route-separation/app.js+5 added
added:examples/route-separation/post.js+17 added