Class: Socializer::NotesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Socializer::NotesController
- Defined in:
- app/controllers/socializer/notes_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#edit ⇒ Object
21 22 |
# File 'app/controllers/socializer/notes_controller.rb', line 21 def edit end |
#new ⇒ Object
5 6 7 8 |
# File 'app/controllers/socializer/notes_controller.rb', line 5 def new @note = Note.new @current_id = params[:id] end |
#update ⇒ Object
24 25 26 27 |
# File 'app/controllers/socializer/notes_controller.rb', line 24 def update @note.update!(params[:note]) redirect_to stream_path end |