Skip to content

Instantly share code, notes, and snippets.

View superhighfives's full-sized avatar

Charlie Gleason superhighfives

View GitHub Profile
@superhighfives
superhighfives / error
Created March 2, 2017 18:40
Rails 5 API + ActiveAdmin + create-react-app on Heroku
$ bin/rails g scaffold drink
Running via Spring preloader in process 38277
Expected string default value for '--serializer'; got true (boolean)
invoke active_record
create db/migrate/20170302183027_create_drinks.rb
create app/models/drink.rb
invoke test_unit
create test/models/drink_test.rb
create test/fixtures/drinks.yml
invoke resource_route
@superhighfives
superhighfives / Gemfile
Created March 2, 2017 18:01
Rails 5 API + ActiveAdmin + create-react-app on Heroku
group :development do
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'foreman', '~> 0.82.0'
end
@superhighfives
superhighfives / start.rake
Last active March 4, 2017 14:35
Rails 5 API + ActiveAdmin + create-react-app on Heroku
namespace :start do
task :development do
exec 'foreman start -f Procfile.dev'
end
desc 'Start production server'
task :production do
exec 'NPM_CONFIG_PRODUCTION=true npm run postinstall && foreman start'
end
end
@superhighfives
superhighfives / package.json
Last active March 6, 2017 14:36
Rails 5 API + ActiveAdmin + create-react-app on Heroku
{
"name": "list-of-ingredients-client",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"react-scripts": "0.9.3",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"semantic-ui-css": "^2.2.9",
@superhighfives
superhighfives / Procfile
Created February 28, 2017 19:44
Rails 5 API + ActiveAdmin + create-react-app on Heroku Raw Raw
web: bundle exec rails s
@superhighfives
superhighfives / .gitignore
Created February 28, 2017 19:40
Rails 5 API + ActiveAdmin + create-react-app on Heroku Raw
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# misc
.DS_Store
@superhighfives
superhighfives / shell
Last active February 28, 2017 19:44
Rails 5 API + ActiveAdmin + create-react-app on Heroku
heroku buildpacks:add heroku/nodejs --index 1
heroku buildpacks:add heroku/ruby --index 2
@superhighfives
superhighfives / App.js
Last active March 6, 2017 14:46
Rails 5 API + ActiveAdmin + create-react-app on Heroku
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
class App extends Component {
componentDidMount() {
window.fetch('api/drinks')
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.log(error))
@superhighfives
superhighfives / Procfile.dev
Last active February 28, 2017 19:44
Rails 5 API + ActiveAdmin + create-react-app on Heroku
web: cd client && PORT=3000 npm start
api: PORT=3001 && bundle exec rails s
@superhighfives
superhighfives / routes.rb
Last active March 3, 2017 00:12
Rails 5 API + ActiveAdmin + create-react-app on Heroku
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
scope '/api' do
resources :drinks
end
end