2   class ReadMarksController < ApplicationController
 
   5     before_action :authorize_web
 
   6     before_action :set_locale
 
   8     authorize_resource :message
 
  10     before_action :check_database_readable
 
  11     before_action :check_database_writable
 
  23     def mark(message_read)
 
  24       @message = current_user.messages.unscope(:where => :muted).find(params[:message_id])
 
  25       @message.message_read = message_read
 
  27         flash[:notice] = t ".notice"
 
  29           redirect_to messages_muted_inbox_path, :status => :see_other
 
  31           redirect_to messages_inbox_path, :status => :see_other
 
  34     rescue ActiveRecord::RecordNotFound
 
  35       @title = t "messages.no_such_message.title"
 
  36       render :template => "messages/no_such_message", :status => :not_found