Skip to content

Instantly share code, notes, and snippets.

@leikind
leikind / render.rb
Created April 20, 2014 11:49
rails render and content type
render :inline => '<html><b>123</b></html>' #=> Content-Type: text/html; charset=utf-8
# Good
render json: {1 => 2}.to_json #=> Content-Type: application/json; charset=utf-8
# this was correct
render xml: '<xml><foo>123</foo></xml>' #=> Content-Type: application/xml; charset=utf-8
@alexandrebodin
alexandrebodin / App.js
Created January 23, 2020 20:46
Strapi graphQL upload mutation
import React from "react";
import "./App.css";
import { ApolloProvider } from "@apollo/react-hooks";
import gql from "graphql-tag";
import { ApolloClient } from "apollo-client";
import { createUploadLink } from "apollo-upload-client";
import { InMemoryCache } from "apollo-cache-inmemory";