summaryrefslogtreecommitdiffhomepage
path: root/app/views
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2020-12-02 19:26:28 -0500
committerrealtradam <[email protected]>2020-12-02 19:26:28 -0500
commitd13b636bd654244f894943c2968a7386e8379605 (patch)
tree410809bae61eac943e1af19ecfd2c2f31143c796 /app/views
downloadrails-tree-style-activerecord-d13b636bd654244f894943c2968a7386e8379605.tar.gz
rails-tree-style-activerecord-d13b636bd654244f894943c2968a7386e8379605.zip
initial
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/application.html.erb15
-rw-r--r--app/views/nodes/index.html.erb15
-rw-r--r--app/views/nodes/new.html.erb18
-rw-r--r--app/views/nodes/show.html.erb9
4 files changed, 57 insertions, 0 deletions
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
new file mode 100644
index 0000000..fdfb342
--- /dev/null
+++ b/app/views/layouts/application.html.erb
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Wiki</title>
+ <%= csrf_meta_tags %>
+ <%= csp_meta_tag %>
+
+ <%= stylesheet_link_tag 'application', media: 'all' %>
+ <%= javascript_pack_tag 'application' %>
+ </head>
+
+ <body>
+ <%= yield %>
+ </body>
+</html>
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb
new file mode 100644
index 0000000..2a14880
--- /dev/null
+++ b/app/views/nodes/index.html.erb
@@ -0,0 +1,15 @@
+<h1> suh </h1>
+
+<% @rootnodes.each do |rootnode| %>
+ <tr>
+ <td>PARENT: <%= rootnode.title %></td>
+ </tr><br>
+ <em>
+ <% rootnode.children.each do |node| %>
+ <tr>
+ <td>CHILD: <%= node[:title] %></td>
+ </tr><br>
+ <% end %>
+ </em>
+<% end %>
+
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb
new file mode 100644
index 0000000..ee0adb6
--- /dev/null
+++ b/app/views/nodes/new.html.erb
@@ -0,0 +1,18 @@
+<h1>new wiki page</h1>
+<%= form_with scope: :node, url: nodes_path, local: true do |form| %>
+ <p>
+ <%= form.label :title %><br>
+ <%= form.text_field :title %>
+ </p>
+
+ <p>
+ <%= form.label :content %><br>
+ <%= form.text_area :content %>
+ </p>
+
+ <%= form.collection_select :parent, @nodes, :id, :title, include_blank: true %>
+
+ <p>
+ <%= form.submit %>
+ </p>
+<% end %>
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb
new file mode 100644
index 0000000..c933d1e
--- /dev/null
+++ b/app/views/nodes/show.html.erb
@@ -0,0 +1,9 @@
+<p>
+<strong>Title:</strong>
+<%= @node.title %>
+</p>
+
+<p>
+<strong>Content:</strong>
+<%= @node.content %>
+</p>