lib/shp_api/json_responder.rb
# Render http 200 OK with data
Render http 200 OK with data
Render http 200 OK with data
def data(data: nil, meta: nil, status: :ok)
      if data
        result = {}
        result["status"] = "success"
        result["meta"] = meta if meta
        result["data"] = data
        json = MultiJson.dump(result)
        @controller.render json: json, status: status
      else
        @controller.head status: :no_content
      end
    end
def data ( data : nil , meta : nil , status : :ok ) if data result = { } result [ "status" ] = "success" result [ "meta" ] = meta if meta result [ "data" ] = data json = MultiJson . dump ( result ) @controller . render json : json , status : status else @controller . head status : :no_content end end
Render http 200 OK with data
Render http 200 OK with data
data
<not_specific>
meta
<not_specific>
status
<not_specific>