This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveAdmin.register Ingredient do | |
permit_params :description, :drink_id | |
# See permitted parameters documentation: | |
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters | |
# | |
# permit_params :list, :of, :attributes, :on, :model | |
# | |
# or | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { Container, Header, Segment, Button, Icon, Dimmer, Loader, Divider } from 'semantic-ui-react' | |
class App extends Component { | |
constructor () { | |
super() | |
this.state = {} | |
this.getDrinks = this.getDrinks.bind(this) | |
this.getDrink = this.getDrink.bind(this) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DrinksController < ApiController | |
# GET /drinks | |
def index | |
@drinks = Drink.select("id, title").all | |
render json: @drinks.to_json | |
end | |
# GET /drinks/:id | |
def show | |
@drink = Drink.find(params[:id]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class IngredientsController < ApiController | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleController < ApiController | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApiController < ActionController::API | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import App from './App' | |
import 'semantic-ui-css/semantic.css' | |
import './index.css' | |
ReactDOM.render( | |
<App />, | |
document.getElementById('root') | |
) |