Remove uneeded files and rename.

This commit is contained in:
Senén Rodero Rodríguez
2017-07-22 18:28:47 +02:00
committed by taitus
parent a188105910
commit fd9bec4d1f
5 changed files with 38 additions and 163 deletions

View File

@@ -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