Make Admin Notifications translatable

This commit is contained in:
Marko Lovic
2018-08-01 14:38:07 +02:00
committed by Javi Martín
parent 5ff85d33d6
commit f6749049c9
8 changed files with 57 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
class Admin::AdminNotificationsController < Admin::BaseController
include Translatable
def index
@admin_notifications = AdminNotification.all
@@ -62,6 +63,13 @@ class Admin::AdminNotificationsController < Admin::BaseController
private
def admin_notification_params
params.require(:admin_notification).permit(:title, :body, :link, :segment_recipient)
attributes = [:title, :body, :link, :segment_recipient,
*translation_params(AdminNotification)]
params.require(:admin_notification).permit(attributes)
end
def resource
AdminNotification.find(params[:id])
end
end