Skip to content

Instantly share code, notes, and snippets.

@hpjaj
Created November 14, 2018 18:06
Show Gist options
  • Save hpjaj/b3f357e2e5981fe7adcd43d556226944 to your computer and use it in GitHub Desktop.
Save hpjaj/b3f357e2e5981fe7adcd43d556226944 to your computer and use it in GitHub Desktop.
// app/javascript/components/NewPost.js
...
import { passCsrfToken } from '../util/helpers'
class NewPost extends React.Component {
state = {
title: '',
body: ''
}
componentDidMount() {
passCsrfToken(document, axios)
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment