Sha256: 2a2aa55fa46b235534848b351a960356b54c52936c7d3fab378121f0e13439cf
Contents?: true
Size: 728 Bytes
Versions: 8
Compression:
Stored size: 728 Bytes
Contents
module Wupee class Api::NotificationsController < ApplicationController before_action :set_notification, only: [:show, :update] def index if params[:is_read] @notifications = current_user.notifications.where(is_read: params[:is_read] == "true") else @notifications = current_user.notifications end end def show end def update @notification.mark_as_read render :show end def update_all current_user.notifications.where(is_read: false).find_each do |n| n.mark_as_read end head :no_content end private def set_notification @notification = current_user.notifications.find(params[:id]) end end end
Version data entries
8 entries across 8 versions & 1 rubygems