retrospring/app/controllers/notifications_controller.rb

13 lines
376 B
Ruby
Raw Normal View History

2014-12-09 22:35:11 +01:00
class NotificationsController < ApplicationController
2014-12-12 17:54:13 +01:00
before_filter :authenticate_user!
2014-12-09 22:35:11 +01:00
def index
2014-12-14 15:17:52 +01:00
@type = params[:type]
2014-12-14 15:24:59 +01:00
@notifications = if @type == 'all'
Notification.for(current_user)
else
Notification.for(current_user).where('LOWER(target_type) = ?', @type)
end
2014-12-09 22:35:11 +01:00
end
end