diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 99f401f7b..16a82de6a 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -11,7 +11,7 @@ class NotificationsController < ApplicationController def show @notification = current_user.notifications.find(params[:id]) - redirect_to url_for(@notification.linkable_resource) + redirect_to linkable_resource_path(@notification) end def mark_all_as_read @@ -25,4 +25,13 @@ class NotificationsController < ApplicationController @notification.mark_as_read end + def linkable_resource_path(notification) + case notification.linkable_resource.class.name + when "Budget::Investment" + budget_investment_path @notification.linkable_resource.budget, @notification.linkable_resource + else + url_for @notification.linkable_resource + end + end + end diff --git a/app/views/welcome/_recommended.html.erb b/app/views/welcome/_recommended.html.erb index 3c6e17294..974e6ae68 100644 --- a/app/views/welcome/_recommended.html.erb +++ b/app/views/welcome/_recommended.html.erb @@ -1,138 +1,29 @@ -