Class: Socializer::NotesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/socializer/notes_controller.rb', line 10

def create
  @note = current_user.activity_object.notes.build(params[:note])
  @note.object_ids = @note.object_ids.split(',')
  @note.activity_verb = 'post'
  @note.save!
  @activity = Activity.find_by(activity_object_id: @note.guid)
  respond_to do |format|
    format.js
  end
end

#destroyObject



29
30
31
32
33
34
35
# File 'app/controllers/socializer/notes_controller.rb', line 29

def destroy
  @activity_guid = Activity.find_by(activity_object_id: @note.guid).guid
  @note.destroy
  respond_to do |format|
    format.js
  end
end

#editObject



21
22
# File 'app/controllers/socializer/notes_controller.rb', line 21

def edit
end

#newObject



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

def new
  @note = Note.new
  @current_id = params[:id]
end

#updateObject



24
25
26
27
# File 'app/controllers/socializer/notes_controller.rb', line 24

def update
  @note.update!(params[:note])
  redirect_to stream_path
end