diff options
author | Marius Mathiesen <marius.mathiesen@gmail.com> | 2009-06-03 16:32:55 +0200 |
---|---|---|
committer | Marius Mathiesen <marius.mathiesen@gmail.com> | 2009-06-03 16:33:09 +0200 |
commit | 83a1a03ef70384844d6a49356a5f41f5bb4ce917 (patch) | |
tree | 8150df99d18a45205205274f397ca11b36db97a9 /app/controllers/messages_controller.rb | |
parent | 09d09243b5e2c546a84b9cc49ab3b9f14ae5d06e (diff) | |
download | gitorious-mainline-outdated-83a1a03ef70384844d6a49356a5f41f5bb4ce917.zip gitorious-mainline-outdated-83a1a03ef70384844d6a49356a5f41f5bb4ce917.tar.gz gitorious-mainline-outdated-83a1a03ef70384844d6a49356a5f41f5bb4ce917.tar.bz2 |
Adding support for marking several messages as read
Diffstat (limited to 'app/controllers/messages_controller.rb')
-rw-r--r-- | app/controllers/messages_controller.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index a11a9a5..675507d 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -41,6 +41,17 @@ class MessagesController < ApplicationController wants.js end end + + def bulk_update + message_ids = params[:message_ids].to_a + message_ids.each do |message_id| + if message = current_user.received_messages.find(message_id) + message.read + end + end + redirect_to :action => :index + end + def show @message = Message.find(params[:id]) @@ -54,6 +65,7 @@ class MessagesController < ApplicationController wants.js {render :partial => "message", :layout => false} end end + def create thread_options = params[:message].merge({ |