Remove uneeded files and rename.
This commit is contained in:
committed by
taitus
parent
a188105910
commit
fd9bec4d1f
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user