diff options
| author | Teddy Wing | 2015-12-30 18:41:49 -0800 | 
|---|---|---|
| committer | Teddy Wing | 2015-12-30 18:41:49 -0800 | 
| commit | e129dc5b3f70005e8b33a62f66e673a9c0d8084c (patch) | |
| tree | a3803e72bb7e9037b0fa552a297f8700362bd151 /app/controllers | |
| parent | a929a40eaad93135ff5c8fea254df03cdd26962e (diff) | |
| download | Evernote-Rails-Example-e129dc5b3f70005e8b33a62f66e673a9c0d8084c.tar.bz2 | |
Include 'kipcole9/evernote' note_store.rb directly
Copy 'note_store.rb' from 'kipcole9/evernote' directly into my Evernote
service file.
I was getting a `LoadError` when trying to load the 'evernote' gem so
to get moving quickly I'm just including the code directly in this app.
We can figure out the issue with the gem later.
Updating `NotesController` to interface with the 'evernote' gem classes
and get notebooks using its API.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/notes_controller.rb | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index bf7f5ab..6b40ca3 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -5,9 +5,14 @@ class NotesController < ApplicationController      auth_token = 'S=s1:U=91e2f:E=151f92661a2:C=151f4000220:P=185:A=evernotesandbox199:V=2:H=5777502290baf1ae1b36ad6254592258'      notestore_url = 'https://sandbox.evernote.com/shard/s1/notestore' -    e = EvernoteService.new(auth_token, notestore_url) -    @notebooks = e.notebooks +    # e = EvernoteService.new(auth_token, notestore_url) +    # @notebooks = e.notebooks      # @notes = @notebooks.collect { |b| e.notes_from_notebook(b) } + +    access_token = auth_token +    note_store = EvernoteService::NoteStore.new(notestore_url, access_token) + +    @notebooks = note_store.list_notebooks    end  end | 
