From 5b18c8156a6735502f735c253d80071b5ae72b84 Mon Sep 17 00:00:00 2001
From: Teddy Wing
Date: Wed, 30 Dec 2015 18:46:23 -0800
Subject: NotesController: Display notes and note contents
For all notebooks, display all notes inside a notebook and the contents
and tags of each note.
Rendering the note contents with `html_safe` to get them to display
quickly in a user-readable form because the contents are formatted in
ENML, Evernote's XML markup language.
Tried collecting the notes in the controller but ultimately decided to
output them directly in the view.
---
app/views/notes/index.html.erb | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'app/views/notes/index.html.erb')
diff --git a/app/views/notes/index.html.erb b/app/views/notes/index.html.erb
index 28d2850..5019db5 100644
--- a/app/views/notes/index.html.erb
+++ b/app/views/notes/index.html.erb
@@ -1,3 +1,9 @@
<% @notebooks.each do |b| %>
<%= b.name %>
+
+ <% b.notes.each do |n| %>
+ <%= n.title %>
+ <%= n.enml.html_safe %>
+ <%= n.tags %>
+ <% end %>
<% end %>
--
cgit v1.2.3