diff options
| author | Teddy Wing | 2015-12-30 18:46:23 -0800 |
|---|---|---|
| committer | Teddy Wing | 2015-12-30 18:46:23 -0800 |
| commit | 5b18c8156a6735502f735c253d80071b5ae72b84 (patch) | |
| tree | e67e341a6fc6725486f6d1683bd716b48871b723 /app/views | |
| parent | e129dc5b3f70005e8b33a62f66e673a9c0d8084c (diff) | |
| download | Evernote-Rails-Example-5b18c8156a6735502f735c253d80071b5ae72b84.tar.bz2 | |
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.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/notes/index.html.erb | 6 |
1 files changed, 6 insertions, 0 deletions
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 %><br /> + + <% b.notes.each do |n| %> + <%= n.title %><br /> + <%= n.enml.html_safe %><br /> + <%= n.tags %> + <% end %> <% end %> |
