Class: Elabs::Member::NotificationsController
- Inherits:
-
MemberApplicationController
- Object
- ActionController::Base
- ElabsApplicationController
- MemberApplicationController
- Elabs::Member::NotificationsController
- Defined in:
- app/controllers/elabs/member/notifications_controller.rb
Constant Summary collapse
- MAX_ITEMS_PER_PAGE =
Elabs.max_members_items_per_page
- DEFAULT_ORDER_FIELD =
'created_at'.freeze
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /notifications/1.
-
#index ⇒ Object
GET /notifications.
Instance Method Details
permalink #destroy ⇒ Object
DELETE /notifications/1
17 18 19 20 |
# File 'app/controllers/elabs/member/notifications_controller.rb', line 17 def destroy @notification.destroy redirect_to member_notifications_url, notice: _('Notification was successfully destroyed.') end |
permalink #index ⇒ Object
GET /notifications
10 11 12 13 14 |
# File 'app/controllers/elabs/member/notifications_controller.rb', line 10 def index order = params['order_by'] || self.class::DEFAULT_ORDER_FIELD direction = params['direction'] || 'desc' @notifications = Notification.for_user(current_user).order(order => direction).page(params[:page]).per(self.class::MAX_ITEMS_PER_PAGE) end |