Skip to content
Myr

more 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 0af9126 · Browse files · 7 files+178 added−0 removed
This commit

State

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

Diff stats

7 files+178 added−0 removed

  • other:+178 added−0 removed

7 files+178 added−0 removed

added:examples/blog/models/post.js+41 added
added:examples/blog/routes/post.js+52 added
added:examples/blog/routes/site.js+12 added
added:examples/blog/views/post/form.jade+18 added
12- if (post.title)3 h1 Editing #{post.title}4- else5 h1 New Post67form#post(action='/post', method='post')8 - if (post.title)9 input(type='hidden', name='_method', value='put')10 p11 label(for='post[title]') Title:12 input(type='text', name='post[title]', value=post.title)13 p14 label(for='post[body]') Body:15 textarea(name='post[body]')= post.body || ''16 p17 input(type='submit', value=post.title ? 'Update' : 'Create')18
added:examples/blog/views/index.jade+15 added
1h1 Blog23- if (count)4 p Display all #{count} posts5- else6 p 7 | It looks like you have no posts!8 | Click9 a(href='/post/add') here10 | to create a post. Login11 | as12 em "admin"13 | and14 em "express"15 | .
added:examples/blog/views/layout.jade+6 added
1!!! 52html3 head4 title Blog5 body6 #container!= body
added:examples/blog/app.js+34 added