feat(example): add example app and blog app with demos
This commit is contained in:
1 parent
28e6bc3cf2
commit
7d2312b94b
13 files changed
+234
No files matched your search
@@ -0,0 +1,4 @@
|
||||
<li class="post" id="post-<%= post.id %>">
|
||||
<h2><%= post.title %></h2>
|
||||
<p><%= post.body %></p>
|
||||
</li>
|
||||
@@ -0,0 +1,21 @@
|
||||
<h1>Blog</h1>
|
||||
<% if notice %>
|
||||
<p class="notice"><%= notice %></p>
|
||||
<% end %>
|
||||
<% unless errors.empty? %>
|
||||
<ul class="errors">
|
||||
<% errors.each do |message| %>
|
||||
<li><%= message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
<form method="post" action="/posts">
|
||||
<input type="text" name="title" placeholder="Title">
|
||||
<textarea name="body" placeholder="Body"></textarea>
|
||||
<button type="submit">Create post</button>
|
||||
</form>
|
||||
<ul class="posts">
|
||||
<% posts.each do |post| %>
|
||||
<%== partial('post', locals: { post: post }) %>
|
||||
<% end %>
|
||||
</ul>
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1><%= post.title %></h1>
|
||||
<p><%= post.body %></p>
|
||||
Reference in new issue
Block a user