Class: Redpen::NotesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/redpen/notes_controller.rb

Overview

The notes on one page. Every write redirects back to the index, which is the whole rail: pins, popovers, the composer. One renderer, so a note looks the same whether it arrived with the page or a second ago.

Instance Method Summary collapse

Methods included from HostRouteHelpers

define_from

Instance Method Details

#create ⇒ Object



10
11
12
13
# File 'app/controllers/redpen/notes_controller.rb', line 10

def create
  notes.create!(note_params)
  redirect_to notes_path(path: path), status: :see_other
end

#destroy ⇒ Object



15
16
17
18
# File 'app/controllers/redpen/notes_controller.rb', line 15

def destroy
  note.destroy
  redirect_to notes_path(path: path), status: :see_other
end

#index ⇒ Object



6
7
8
# File 'app/controllers/redpen/notes_controller.rb', line 6

def index
  @notes = notes.ordered
end