mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
Remove injection_json that renders json partials, we only use ams serializers now, not rabl partials
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
:javascript
|
||||
angular.module('Darkswarm').value("#{name.to_s}", #{render partial: "json/#{partial.to_s}"})
|
||||
Reference in New Issue
Block a user