Remove injection_json that renders json partials, we only use ams serializers now, not rabl partials

This commit is contained in:
luisramos0
2019-07-21 22:58:06 +01:00
parent a8ce31fa90
commit 9b567a6710
3 changed files with 16 additions and 6 deletions

View File

@@ -119,10 +119,6 @@ module InjectionHelper
inject_json_ams "railsFlash", OpenStruct.new(flash.to_hash), Api::RailsFlashSerializer
end
def inject_json(name, partial, opts = {})
render partial: "json/injection", locals: { name: name, partial: partial }.merge(opts)
end
def inject_json_ams(name, data, serializer, opts = {})
if data.is_a?(Array)
opts = { each_serializer: serializer }.merge(opts)

View File

@@ -1,3 +1,19 @@
class Api::RailsFlashSerializer < ActiveModel::Serializer
attributes :info, :success, :error, :notice
def info
object.info
end
def success
object.success
end
def error
object.error
end
def notice
object.notice
end
end

View File

@@ -1,2 +0,0 @@
:javascript
angular.module('Darkswarm').value("#{name.to_s}", #{render partial: "json/#{partial.to_s}"})