diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 0b76fd2a0..6c948f914 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -3,13 +3,18 @@ class NotificationsController < ApplicationController def index authorize! - per_page = params[:number_of_items_per_page].presence || 25 - base_scope = authorized_scope(Notification.includes(:noticeable)) - filtered = base_scope.search_by_params(params.to_unsafe_h) - @notifications = filtered.order(created_at: :desc) - .paginate(page: params[:page], per_page: per_page) - render turbo_frame_request? ? :notifications_results : :index + if turbo_frame_request? + per_page = params[:number_of_items_per_page].presence || 25 + base_scope = authorized_scope(Notification.includes(:noticeable)) + filtered = base_scope.search_by_params(params.to_unsafe_h) + @notifications = filtered.order(created_at: :desc) + .paginate(page: params[:page], per_page: per_page) + + render :notifications_results + else + render :index + end end def show diff --git a/app/views/notifications/_index.html.erb b/app/views/notifications/_index.html.erb index ad0e3e9bd..22898cca7 100644 --- a/app/views/notifications/_index.html.erb +++ b/app/views/notifications/_index.html.erb @@ -44,6 +44,7 @@ <% if notification.noticeable.present? %> <%= link_to notification.noticeable.class.name, polymorphic_path(notification.noticeable), + data: { turbo_frame: "_top" }, class: "btn btn-secondary-outline" %> <% else %> — @@ -54,6 +55,7 @@
| + | + | + | + | + |
|---|---|---|---|---|
| + | + | + | + | + |